bajo-template 2.2.0 → 2.2.2
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/index.js +5 -5
- package/package.json +1 -1
- package/wiki/CHANGES.md +8 -0
package/index.js
CHANGED
|
@@ -168,7 +168,7 @@ async function factory (pkgName) {
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
_renderString = async (content, locals = {}, opts = {}) => {
|
|
171
|
-
const { merge, without, isString, omit, kebabCase } = this.app.lib._
|
|
171
|
+
const { merge, without, isString, omit, kebabCase, get } = this.app.lib._
|
|
172
172
|
if (opts.ext === '.md' && this.app.bajoMarkdown) {
|
|
173
173
|
content = await this.compile(content, locals, { lang: opts.lang, ttl: -1 }) // markdown can't process template tags, hence preprocess here
|
|
174
174
|
content = this.app.bajoMarkdown.parse(content)
|
|
@@ -203,9 +203,9 @@ async function factory (pkgName) {
|
|
|
203
203
|
}
|
|
204
204
|
if (layoutFm.title && !locals.page.title) locals.page.title = layoutFm.title
|
|
205
205
|
content = layoutContent.replace('<!-- body -->', content)
|
|
206
|
-
const
|
|
207
|
-
const fullTitle =
|
|
208
|
-
locals.page.fullTitle = locals.fullTitle ?? fullTitle
|
|
206
|
+
const usePluginTitle = get(this, 'app.waibuMpa.config.page.usePluginTitle')
|
|
207
|
+
const fullTitle = usePluginTitle ? `${locals.page.title} - ${this.app.waibuMpa.getPluginTitle(locals.page.ns, opts.lang)}` : locals.page.title
|
|
208
|
+
locals.page.fullTitle = locals.page.fullTitle ?? fullTitle
|
|
209
209
|
}
|
|
210
210
|
content = await this.compile(content, locals, { lang: opts.lang, ttl: this.config.cache.maxAgeDur })
|
|
211
211
|
return await this._handleInclude(content, locals, opts)
|
|
@@ -235,7 +235,7 @@ async function factory (pkgName) {
|
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
if (isEmpty(success)) return {}
|
|
238
|
-
return parseObject(success, { parseValue:
|
|
238
|
+
return parseObject(success, { parseValue: false, lang }) ?? {}
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
compile = async (content, locals, { lang, ttl = 0 } = {}) => {
|
package/package.json
CHANGED