bajo-template 2.2.0 → 2.2.1
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 +4 -4
- package/package.json +1 -1
- package/wiki/CHANGES.md +4 -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)
|
package/package.json
CHANGED