notherbase-fs 3.2.16 → 3.2.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/controllers/creation.js +6 -5
- package/notherbase-fs.js +6 -2
- package/package.json +1 -1
package/controllers/creation.js
CHANGED
|
@@ -5,7 +5,8 @@ import fs from 'fs';
|
|
|
5
5
|
* Creation is all the renedered pages in a base.
|
|
6
6
|
*/
|
|
7
7
|
export default class Creation {
|
|
8
|
-
constructor() {
|
|
8
|
+
constructor(siteTitle = "Base") {
|
|
9
|
+
this.siteTitle = siteTitle;
|
|
9
10
|
this.router = express.Router();
|
|
10
11
|
|
|
11
12
|
//home
|
|
@@ -88,7 +89,7 @@ export default class Creation {
|
|
|
88
89
|
*/
|
|
89
90
|
front = async (req, res, next) => {
|
|
90
91
|
req.main = req.contentPath + "/the-front/index";
|
|
91
|
-
req.siteTitle =
|
|
92
|
+
req.siteTitle = this.siteTitle;
|
|
92
93
|
req.toRender = "explorer";
|
|
93
94
|
next();
|
|
94
95
|
}
|
|
@@ -101,7 +102,7 @@ export default class Creation {
|
|
|
101
102
|
*/
|
|
102
103
|
frontDetail = async (req, res, next) => {
|
|
103
104
|
req.main = `${req.contentPath}/the-front/${req.params.frontDetail}/index`;
|
|
104
|
-
req.siteTitle =
|
|
105
|
+
req.siteTitle = `${this.siteTitle} - ${req.params.frontDetail}`;
|
|
105
106
|
req.toRender = "explorer";
|
|
106
107
|
next();
|
|
107
108
|
}
|
|
@@ -114,7 +115,7 @@ export default class Creation {
|
|
|
114
115
|
*/
|
|
115
116
|
poi = async (req, res, next) => {
|
|
116
117
|
req.main = `${req.contentPath}/${req.params.region}/${req.params.area}/${req.params.poi}/index`;
|
|
117
|
-
req.siteTitle =
|
|
118
|
+
req.siteTitle = `${this.siteTitle} - ${req.params.poi}`;
|
|
118
119
|
req.toRender = "explorer";
|
|
119
120
|
next();
|
|
120
121
|
}
|
|
@@ -127,7 +128,7 @@ export default class Creation {
|
|
|
127
128
|
*/
|
|
128
129
|
detail = async (req, res, next) => {
|
|
129
130
|
req.main = `${req.contentPath}/${req.params.region}/${req.params.area}/${req.params.poi}/${req.params.detail}/index`;
|
|
130
|
-
req.siteTitle =
|
|
131
|
+
req.siteTitle = `${this.siteTitle} - ${req.params.detail}`;
|
|
131
132
|
req.toRender = "explorer";
|
|
132
133
|
next();
|
|
133
134
|
}
|
package/notherbase-fs.js
CHANGED
|
@@ -17,11 +17,15 @@ import SpiritWorld from "./controllers/spirit-world.js";
|
|
|
17
17
|
* The engine that runs a nother base.
|
|
18
18
|
*/
|
|
19
19
|
class NotherBaseFS {
|
|
20
|
-
constructor(contentPath, globals = null) {
|
|
20
|
+
constructor(contentPath, globals = null, settings = {}) {
|
|
21
|
+
this.settings = {
|
|
22
|
+
siteTitle: "NotherBase",
|
|
23
|
+
...settings
|
|
24
|
+
}
|
|
21
25
|
this.app = express();
|
|
22
26
|
this.server = http.createServer(this.app);
|
|
23
27
|
this.io = new Server(this.server);
|
|
24
|
-
this.creation = new Creation();
|
|
28
|
+
this.creation = new Creation(this.settings.siteTitle);
|
|
25
29
|
this.spiritWorld = new SpiritWorld(this.io);
|
|
26
30
|
|
|
27
31
|
//set views path
|