[fix] skip_search is not iterable (#526)

This commit is contained in:
星日语 2024-10-12 18:26:00 +08:00 committed by GitHub
parent b558afd782
commit bc5760aadb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -75,7 +75,7 @@ hexo.extend.generator.register('search_json_generator', function (locals) {
posts.each(function(post) { posts.each(function(post) {
var layout_list = ["post"] var layout_list = ["post"]
if (!layout_list.includes(post.layout)) return if (!layout_list.includes(post.layout)) return
if (matchAndExit(post.path, cfg.skip_search)) return if (cfg.skip_search && matchAndExit(post.path, cfg.skip_search)) return
if (post.indexing == false) return if (post.indexing == false) return
let temp_post = generateJson(post) let temp_post = generateJson(post)
res.push(temp_post) res.push(temp_post)
@ -85,7 +85,7 @@ hexo.extend.generator.register('search_json_generator', function (locals) {
pages.each(function(page) { pages.each(function(page) {
var layout_list = ["page", "wiki"] var layout_list = ["page", "wiki"]
if (!layout_list.includes(page.layout)) return if (!layout_list.includes(page.layout)) return
if (matchAndExit(page.path, cfg.skip_search)) return if (cfg.skip_search && matchAndExit(page.path, cfg.skip_search)) return
if (page.indexing == false) return if (page.indexing == false) return
let temp_post = generateJson(page) let temp_post = generateJson(page)
res.push(temp_post) res.push(temp_post)