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)