diff --git a/_config.yml b/_config.yml index 47d692e..459fb5c 100644 --- a/_config.yml +++ b/_config.yml @@ -106,5 +106,21 @@ deploy: repo: git@github.com:meowjay1110/meowjay.github.io.git branch: main +# Hide posts hide_posts: + # 是否启用 hexo-hide-posts enable: true + + # 隐藏文章的 front-matter 标识,也可以改成其他你喜欢的名字 + filter: hidden + + # 为隐藏的文章添加 noindex meta 标签,阻止搜索引擎收录 + noindex: true + + # 设置白名单,白名单中的 generator 可以访问隐藏文章 + # 常见的 generators 有:index, tag, category, archive, sitemap, feed, etc. + allowlist_generators: ['*'] + + # 设置黑名单,黑名单中的 generator 不可以访问隐藏文章 + # 如果同时设置了黑名单和白名单,白名单的优先级更高 + blocklist_generators: ['index','archive'] \ No newline at end of file diff --git a/scripts/acl.js b/scripts/acl.js deleted file mode 100644 index 6a76383..0000000 --- a/scripts/acl.js +++ /dev/null @@ -1,16 +0,0 @@ -// FILE: scripts/acl.js - -hexo.config.hide_posts.acl_function_per_post = function (post, generatorName) { - // 在 front-matter 中标记为 `acl: to-ame` 的文章只能通过网址访问 - if (post.toame) { - return generatorName !== 'index'; - } - - // 标记为 `hidden: true` 的文章在主页隐藏 - if (post.hidden) { - return generatorName !== 'index'; - } - - // 其他文章正常显示 - return true; - } \ No newline at end of file