bajo-template 2.0.1 → 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.
Files changed (51) hide show
  1. package/.github/FUNDING.yml +0 -0
  2. package/.github/workflows/repo-lockdown.yml +0 -0
  3. package/.jsdoc.conf.json +0 -0
  4. package/LICENSE +0 -0
  5. package/README.md +0 -0
  6. package/docs/BajoTemplate.html +0 -0
  7. package/docs/data/search.json +0 -0
  8. package/docs/fonts/Inconsolata-Regular.ttf +0 -0
  9. package/docs/fonts/OpenSans-Regular.ttf +0 -0
  10. package/docs/fonts/WorkSans-Bold.ttf +0 -0
  11. package/docs/global.html +0 -0
  12. package/docs/index.html +0 -0
  13. package/docs/index.js.html +0 -0
  14. package/docs/scripts/core.js +476 -477
  15. package/docs/scripts/core.min.js +0 -0
  16. package/docs/scripts/resize.js +36 -36
  17. package/docs/scripts/search.js +105 -105
  18. package/docs/scripts/search.min.js +0 -0
  19. package/docs/scripts/third-party/Apache-License-2.0.txt +0 -0
  20. package/docs/scripts/third-party/fuse.js +1 -1
  21. package/docs/scripts/third-party/hljs-line-num-original.js +282 -285
  22. package/docs/scripts/third-party/hljs-line-num.js +1 -1
  23. package/docs/scripts/third-party/hljs-original.js +1195 -1202
  24. package/docs/scripts/third-party/hljs.js +1 -1
  25. package/docs/scripts/third-party/popper.js +1 -1
  26. package/docs/scripts/third-party/tippy.js +1 -1
  27. package/docs/scripts/third-party/tocbot.js +508 -509
  28. package/docs/scripts/third-party/tocbot.min.js +0 -0
  29. package/docs/static/bitcoin.jpeg +0 -0
  30. package/docs/static/home.md +0 -0
  31. package/docs/static/logo-ecosystem.png +0 -0
  32. package/docs/static/logo.png +0 -0
  33. package/docs/styles/clean-jsdoc-theme-base.css +0 -0
  34. package/docs/styles/clean-jsdoc-theme-dark.css +0 -0
  35. package/docs/styles/clean-jsdoc-theme-light.css +0 -0
  36. package/docs/styles/clean-jsdoc-theme-scrollbar.css +0 -0
  37. package/docs/styles/clean-jsdoc-theme-without-scrollbar.min.css +0 -0
  38. package/docs/styles/clean-jsdoc-theme.min.css +0 -0
  39. package/extend/bajo/intl/en-US.json +0 -0
  40. package/extend/bajo/intl/id.json +0 -0
  41. package/extend/bajoTemplate/layout/default.html +0 -0
  42. package/extend/bajoTemplate/layout/email.html +0 -0
  43. package/extend/bajoTemplate/layout/email.id.html +0 -0
  44. package/extend/bajoTemplate/partial/script-block.html +0 -0
  45. package/extend/bajoTemplate/partial/style-block.html +0 -0
  46. package/index.js +7 -10
  47. package/lib/resolve-resource.js +0 -0
  48. package/package.json +3 -2
  49. package/wiki/CHANGES.md +9 -0
  50. package/wiki/CONFIG.md +0 -0
  51. package/wiki/CONTRIBUTING.md +0 -0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/index.js CHANGED
@@ -16,9 +16,7 @@ async function factory (pkgName) {
16
16
  *
17
17
  * @class
18
18
  */
19
- class BajoTemplate extends this.app.pluginClass.base {
20
- static alias = 'tpl'
21
-
19
+ class BajoTemplate extends this.app.baseClass.Base {
22
20
  constructor () {
23
21
  super(pkgName, me.app)
24
22
  this.config = {
@@ -170,7 +168,7 @@ async function factory (pkgName) {
170
168
  }
171
169
 
172
170
  _renderString = async (content, locals = {}, opts = {}) => {
173
- const { merge, without, isString, omit, kebabCase } = this.app.lib._
171
+ const { merge, without, isString, omit, kebabCase, get } = this.app.lib._
174
172
  if (opts.ext === '.md' && this.app.bajoMarkdown) {
175
173
  content = await this.compile(content, locals, { lang: opts.lang, ttl: -1 }) // markdown can't process template tags, hence preprocess here
176
174
  content = this.app.bajoMarkdown.parse(content)
@@ -205,9 +203,9 @@ async function factory (pkgName) {
205
203
  }
206
204
  if (layoutFm.title && !locals.page.title) locals.page.title = layoutFm.title
207
205
  content = layoutContent.replace('<!-- body -->', content)
208
- const appTitle = this.t(locals.page.appTitle, { lang: opts.lang })
209
- const fullTitle = locals.page.title ? `${locals.page.title} - ${appTitle}` : appTitle
210
- 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
211
209
  }
212
210
  content = await this.compile(content, locals, { lang: opts.lang, ttl: this.config.cache.maxAgeDur })
213
211
  return await this._handleInclude(content, locals, opts)
@@ -225,7 +223,7 @@ async function factory (pkgName) {
225
223
 
226
224
  parseFrontMatter = async (input = '', lang) => {
227
225
  const { isEmpty, isPlainObject, isArray, filter, map } = this.app.lib._
228
- const { parseObject } = this.app.bajo
226
+ const { parseObject } = this.app.lib
229
227
  const handlers = map(filter(this.app.configHandlers, h => !['.js'].includes(h.ext)), h => h.readHandler)
230
228
  let success
231
229
  for (const handler of handlers) {
@@ -242,8 +240,7 @@ async function factory (pkgName) {
242
240
 
243
241
  compile = async (content, locals, { lang, ttl = 0 } = {}) => {
244
242
  locals.attr = locals.attr ?? {}
245
- const _ = this.app.lib._
246
- const { template } = _
243
+ const { template } = this.app.lib._
247
244
  const cache = this.app.bajoCache
248
245
  let canCache = this.config.cache !== false && cache && this.app.bajo.config.env !== 'dev'
249
246
  if (ttl === -1) canCache = false
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bajo-template",
3
- "version": "2.0.1",
3
+ "version": "2.2.1",
4
4
  "description": "Template Renderer for Bajo Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -9,7 +9,8 @@
9
9
  },
10
10
  "type": "module",
11
11
  "bajo": {
12
- "type": "plugin"
12
+ "type": "plugin",
13
+ "alias": "tpl"
13
14
  },
14
15
  "repository": {
15
16
  "type": "git",
@@ -0,0 +1,9 @@
1
+ # Changes
2
+
3
+ ## 2026-01-21
4
+
5
+ - [2.1.1] Updates on page titles
6
+
7
+ ## 2025-12-30
8
+
9
+ - [2.1.0] Ported to match ```bajo@2.2.x``` specs
package/wiki/CONFIG.md CHANGED
File without changes
File without changes