waibu 2.3.4 → 2.4.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 +7 -2
- package/lib/build-locals.js +1 -1
- package/package.json +1 -1
- package/wiki/CHANGES.md +5 -0
package/index.js
CHANGED
|
@@ -458,7 +458,7 @@ async function factory (pkgName) {
|
|
|
458
458
|
const { defaultsDeep } = this.app.lib.aneka
|
|
459
459
|
const { isEmpty, get, trimEnd, trimStart } = this.app.lib._
|
|
460
460
|
const { breakNsPath } = this.app.bajo
|
|
461
|
-
const { query = {}, base = this.ns, params = {}, guessHost } = options
|
|
461
|
+
const { query = {}, base = this.ns, params = {}, guessHost, defaults = {} } = options
|
|
462
462
|
|
|
463
463
|
const plugin = getPlugin(base)
|
|
464
464
|
const cfg = plugin.config ?? {}
|
|
@@ -474,7 +474,12 @@ async function factory (pkgName) {
|
|
|
474
474
|
if (info.path.includes('//')) return info.path
|
|
475
475
|
|
|
476
476
|
info.path = info.path.split('/').map(p => {
|
|
477
|
-
|
|
477
|
+
if (!(p[0] === ':' || (p[0] === '{' && p[p.length - 1] === '}'))) return p
|
|
478
|
+
const _p = p
|
|
479
|
+
p = p.replace(':', '').replace('{', '').replace('}', '')
|
|
480
|
+
if (params[p]) return params[p]
|
|
481
|
+
if (defaults[p]) return defaults[p]
|
|
482
|
+
return _p
|
|
478
483
|
}).join('/')
|
|
479
484
|
let url = info.path
|
|
480
485
|
const langDetector = get(cfg, 'intl.detectors', [])
|
package/lib/build-locals.js
CHANGED
|
@@ -56,7 +56,7 @@ async function buildLocals ({ tpl, params = {}, opts = {} } = {}) {
|
|
|
56
56
|
const { runHook } = this.app.bajo
|
|
57
57
|
const { set, merge, pick, get, isEmpty, find, pullAt } = this.app.lib._
|
|
58
58
|
const { req, reply } = opts
|
|
59
|
-
params.page = merge(params.page ?? {}, { ns: req.ns })
|
|
59
|
+
params.page = merge(params.page ?? {}, { ns: req.ns, features: [] })
|
|
60
60
|
params.sidebar = params.sidebar ?? []
|
|
61
61
|
|
|
62
62
|
const { site, user, lang, darkMode } = req
|
package/package.json
CHANGED
package/wiki/CHANGES.md
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2026-02-16
|
|
4
|
+
|
|
5
|
+
- [2.4.1] Bug fix on page with features
|
|
6
|
+
|
|
3
7
|
## 2026-02-09
|
|
4
8
|
|
|
5
9
|
- [2.3.4] Bug fix on error handling
|
|
6
10
|
- [2.3.4] Bug fix on not found handling
|
|
7
11
|
- [2.3.4] Bug fix on redirection handling
|
|
12
|
+
- [2.4.0] Accept path parameter as in ```{param}``` to complement ```:param``` in ```routePath()```
|
|
8
13
|
|
|
9
14
|
## 2026-02-08
|
|
10
15
|
|