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 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 appTitle = this.t(locals.page.appTitle, { lang: opts.lang })
207
- const fullTitle = locals.page.title ? `${locals.page.title} - ${appTitle}` : appTitle
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: true, lang }) ?? {}
238
+ return parseObject(success, { parseValue: false, lang }) ?? {}
239
239
  }
240
240
 
241
241
  compile = async (content, locals, { lang, ttl = 0 } = {}) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bajo-template",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "Template Renderer for Bajo Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-02-05
4
+
5
+ - [2.2.2] Bug fix on front matter parsing
6
+
7
+ ## 2026-01-21
8
+
9
+ - [2.1.1] Updates on page titles
10
+
3
11
  ## 2025-12-30
4
12
 
5
13
  - [2.1.0] Ported to match ```bajo@2.2.x``` specs