hexo-swpp 2.4.1 → 2.4.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/lib/jsonBuilder.js +5 -6
- package/package.json +1 -1
package/lib/jsonBuilder.js
CHANGED
|
@@ -267,22 +267,21 @@ module.exports = (hexo, config, pluginConfig, swRules) => {
|
|
|
267
267
|
const isMerge = (pathname, tidied) => {
|
|
268
268
|
// noinspection JSUnresolvedVariable
|
|
269
269
|
const optional = pluginConfig.json?.merge
|
|
270
|
-
if (!optional) return false
|
|
271
270
|
const {tag_dir, archive_dir, category_dir} = config
|
|
272
271
|
if (pathname.includes(`/${tag_dir}/`)) {
|
|
273
|
-
if (optional
|
|
272
|
+
if (optional?.tags ?? true)
|
|
274
273
|
return tidied.tags = true
|
|
275
274
|
} else if (pathname.includes(`/${archive_dir}/`)) {
|
|
276
|
-
if (optional
|
|
275
|
+
if (optional?.archives ?? true)
|
|
277
276
|
return tidied.archives = true
|
|
278
277
|
} else if (pathname.includes(`/${category_dir}/`)) {
|
|
279
|
-
if (optional
|
|
278
|
+
if (optional?.categories ?? true)
|
|
280
279
|
return tidied.categories = true
|
|
281
280
|
} else if (pathname.startsWith('/page/') || pathname.length <= 1) {
|
|
282
|
-
if (optional
|
|
281
|
+
if (optional?.index ?? true)
|
|
283
282
|
return tidied.index = true
|
|
284
283
|
} else {
|
|
285
|
-
const list = optional
|
|
284
|
+
const list = optional?.custom
|
|
286
285
|
if (!list) return false
|
|
287
286
|
for (let reg of list) {
|
|
288
287
|
if (pathname.startsWith(`/${reg}/`))
|