From bc5760aadba06406f3de0f7f3b39bd8b6888e9f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E6=97=A5=E8=AF=AD?= Date: Sat, 12 Oct 2024 18:26:00 +0800 Subject: [PATCH] [fix] skip_search is not iterable (#526) --- scripts/generators/search.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/generators/search.js b/scripts/generators/search.js index eb999fa..930738b 100644 --- a/scripts/generators/search.js +++ b/scripts/generators/search.js @@ -75,7 +75,7 @@ hexo.extend.generator.register('search_json_generator', function (locals) { posts.each(function(post) { var layout_list = ["post"] 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 let temp_post = generateJson(post) res.push(temp_post) @@ -85,7 +85,7 @@ hexo.extend.generator.register('search_json_generator', function (locals) { pages.each(function(page) { var layout_list = ["page", "wiki"] 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 let temp_post = generateJson(page) res.push(temp_post)