notherbase-fs 4.0.4 → 4.0.5
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 +4 -5
- package/package.json +1 -1
- package/test-index.js +2 -0
package/controllers/creation.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import express from "express";
|
|
2
2
|
import fs from 'fs';
|
|
3
|
-
import { fileURLToPath } from 'node:url';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* Creation is all the renedered pages in a base.
|
|
@@ -90,7 +89,7 @@ export default class Creation {
|
|
|
90
89
|
*/
|
|
91
90
|
front = async (req, res, next) => {
|
|
92
91
|
req.main = req.contentPath + "/the-front/index";
|
|
93
|
-
req.siteTitle = this.
|
|
92
|
+
req.siteTitle = this.bases[req.hosting].title;
|
|
94
93
|
req.toRender = "explorer";
|
|
95
94
|
next();
|
|
96
95
|
}
|
|
@@ -103,7 +102,7 @@ export default class Creation {
|
|
|
103
102
|
*/
|
|
104
103
|
frontDetail = async (req, res, next) => {
|
|
105
104
|
req.main = `${req.contentPath}/the-front/${req.params.frontDetail}/index`;
|
|
106
|
-
req.siteTitle = `${this.
|
|
105
|
+
req.siteTitle = `${this.bases[req.hosting].title} - ${req.params.frontDetail}`;
|
|
107
106
|
req.toRender = "explorer";
|
|
108
107
|
next();
|
|
109
108
|
}
|
|
@@ -116,7 +115,7 @@ export default class Creation {
|
|
|
116
115
|
*/
|
|
117
116
|
poi = async (req, res, next) => {
|
|
118
117
|
req.main = `${req.contentPath}/${req.params.region}/${req.params.area}/${req.params.poi}/index`;
|
|
119
|
-
req.siteTitle = `${this.
|
|
118
|
+
req.siteTitle = `${this.bases[req.hosting].title} - ${req.params.poi}`;
|
|
120
119
|
req.toRender = "explorer";
|
|
121
120
|
next();
|
|
122
121
|
}
|
|
@@ -129,7 +128,7 @@ export default class Creation {
|
|
|
129
128
|
*/
|
|
130
129
|
detail = async (req, res, next) => {
|
|
131
130
|
req.main = `${req.contentPath}/${req.params.region}/${req.params.area}/${req.params.poi}/${req.params.detail}/index`;
|
|
132
|
-
req.siteTitle = `${this.
|
|
131
|
+
req.siteTitle = `${this.bases[req.hosting].title} - ${req.params.detail}`;
|
|
133
132
|
req.toRender = "explorer";
|
|
134
133
|
next();
|
|
135
134
|
}
|
package/package.json
CHANGED
package/test-index.js
CHANGED
|
@@ -3,10 +3,12 @@ import { fileURLToPath } from 'node:url';
|
|
|
3
3
|
|
|
4
4
|
const notherBaseFS = new NotherBaseFS({}, {
|
|
5
5
|
notherbase: {
|
|
6
|
+
title: "NotherBase",
|
|
6
7
|
directory: fileURLToPath(new URL('./test', import.meta.url)),
|
|
7
8
|
icon: '/public/drum.png'
|
|
8
9
|
},
|
|
9
10
|
test: {
|
|
11
|
+
title: "TestBase",
|
|
10
12
|
directory: fileURLToPath(new URL('./test2', import.meta.url)),
|
|
11
13
|
icon: '/public/drum.png'
|
|
12
14
|
}
|