prinsss / hexo-hide-posts Goto Github PK
View Code? Open in Web Editor NEWA plugin to hide specific posts from your Hexo blog and make them only accessible by links. (隐藏 Hexo 文章)
License: MIT License
A plugin to hide specific posts from your Hexo blog and make them only accessible by links. (隐藏 Hexo 文章)
License: MIT License
在使用过程中, 发现设置了隐藏后的文章, Toc也没有了。
隐藏掉Top,不知这是一个正常的功能, 还是一个被躺枪的牵连?
安装后hexo g时
TypeError: Cannot read property 'includes' of null
at Hexo.<anonymous> (D:\hexo\node_modules\hexo-hide-posts\index.js:125:13)
at Hexo.tryCatcher (D:\hexo\node_modules\bluebird\js\release\util.js:16:23)
at Hexo.<anonymous> (D:\hexo\node_modules\bluebird\js\release\method.js:15:34)
at D:\hexo\node_modules\hexo\lib\extend\filter.js:62:52
at tryCatcher (D:\hexo\node_modules\bluebird\js\release\util.js:16:23)
at Object.gotValue (D:\hexo\node_modules\bluebird\js\release\reduce.js:166:18)
at Object.gotAccum (D:\hexo\node_modules\bluebird\js\release\reduce.js:155:25)
at Object.tryCatcher (D:\hexo\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (D:\hexo\node_modules\bluebird\js\release\promise.js:547:31)
at Promise._settlePromise (D:\hexo\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (D:\hexo\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (D:\hexo\node_modules\bluebird\js\release\promise.js:729:18)
at _drainQueueStep (D:\hexo\node_modules\bluebird\js\release\async.js:93:12)
at _drainQueue (D:\hexo\node_modules\bluebird\js\release\async.js:86:9)
at Async._drainQueues (D:\hexo\node_modules\bluebird\js\release\async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (D:\hexo\node_modules\bluebird\js\release\async.js:15:14)
at processImmediate (internal/timers.js:456:21)
博客使用hexo-abbrlink 修改了url。之后要怎么访问隐藏的文章?
使用的版本是最新版
这是 hexo version 的输出
hexo: 4.2.0
hexo-cli: 3.1.0
os: Windows_NT 10.0.18363 win32 x64
node: 13.8.0
v8: 7.9.317.25-node.28
uv: 1.34.1
zlib: 1.2.11
brotli: 1.0.7
ares: 1.15.0
modules: 79
nghttp2: 1.40.0
napi: 5
llhttp: 2.0.4
openssl: 1.1.1d
cldr: 36.0
icu: 65.1
tz: 2019c
unicode: 12.1
这是 package.json
{
"name": "hexo-site",
"version": "0.0.0",
"private": true,
"scripts": {
"build": "hexo generate",
"clean": "hexo clean",
"deploy": "hexo deploy",
"server": "hexo server"
},
"hexo": {
"version": "4.2.0"
},
"dependencies": {
"aplayer": "^1.10.1",
"hexo": "^4.2.0",
"hexo-abbrlink": "^2.0.5",
"hexo-auto-category": "^0.2.0",
"hexo-baidu-url-submit": "0.0.6",
"hexo-blog-encrypt": "^3.0.12",
"hexo-cli": "^3.1.0",
"hexo-deployer-git": "^2.1.0",
"hexo-generator-archive": "^1.0.0",
"hexo-generator-baidu-sitemap": "^0.1.6",
"hexo-generator-category": "^1.0.0",
"hexo-generator-feed": "^2.2.0",
"hexo-generator-index": "^1.0.0",
"hexo-generator-search": "^2.4.0",
"hexo-generator-searchdb": "^1.2.0",
"hexo-generator-sitemap": "^2.0.0",
"hexo-generator-tag": "^1.0.0",
"hexo-hide-posts": "^0.1.0",
"hexo-offline": "^1.0.0",
"hexo-renderer-ejs": "^1.0.0",
"hexo-renderer-marked": "^2.0.0",
"hexo-renderer-pug": "^1.0.0",
"hexo-renderer-stylus": "^1.1.0",
"hexo-server": "^1.0.0",
"hexo-symbols-count-time": "^0.7.0",
"hexo-tag-aplayer": "^3.0.4",
"hexo-wordcount": "^6.0.1",
"image-size": "^0.8.3"
}
}
可以看看怎么回事吗
我这样填的配置:
hide_posts:
filter: hide
# 常见的 generators 有:index, tag, category, archive, sitemap, feed, etc.
public_generators: [category]
noindex: true
但指定隐藏的文章并没有生成在categories目录下
不知道你能否复现。
hexo new draft just-a-draft
hexo clean && hexo s --draft --debug
just-a-draft.md
---
title: just-a-draft
draft: true
hidden: true
comments: false
---
编辑 just-a-draft.md,hexo-server 热刷新后,文章会无法访问(还有一种情况是,文章一直是刚启动 hexo server 时的状态,编辑更新的内容不出现)。
被隐藏博文内代码高亮插件失效
我想要一部份文章套用 public_generators: ['xml', 'json']
另一些文章套用 public_generators: ['index', 'tag', 'category', 'archive', 'xml', 'json']
請問是否存在某種方式可以達到?
Am I right that this does not work for a page? Can I change that somewhere so it does allow for pages to be hidden?
配置了隐藏后本地 search 也搜索不到文章了,在 _config.yml
的 public_generators
中配置了 searchdb
也不起作用。
想要显示完整的文章总数,但是似乎隐藏的文章不计入总数。
请问有什么方式可以优化,感谢!
当前配置:
# 隐藏文章
hide_posts:
# 是否启用 hexo-hide-posts
enable: true
# 隐藏文章的 front-matter 标识,也可以改成其他你喜欢的名字
filter: hidden
# 为隐藏的文章添加 noindex meta 标签,阻止搜索引擎收录
noindex: false
# 设置白名单,白名单中的 generator 可以访问隐藏文章
# 常见的 generators 有:index, tag, category, archive, sitemap, feed, etc.
allowlist_generators: ['*']
# 设置黑名单,黑名单中的 generator 不可以访问隐藏文章
# 如果同时设置了黑名单和白名单,白名单的优先级更高
blocklist_generators: ['index']
经测试,Hexo 7.0 下,在分类和标签页面能看到隐藏文章对应的分类和标签。
能不能彻底隐藏某篇文章? 即当隐藏的文章,被知道URL后,在浏览器里访问时, 也会给一个恰当的反馈, 而不是像现在一样,可以正常查看?
现在使用Sage管理隐藏文章, 后面可能随着影藏文章的变多, 一些链接自己也记不住了。
这样, 针对这个问题, 是否考虑添加隐藏文章的列表, 方便查看已经隐藏的文章?
当然,现在想到一些方法是, 使用某些Linux命令来搜索sage的关键字。这个方法可以达到效果,但繁琐。
所以还是期望在Sage中能有这样一个功能。
请问想弄一个隐藏文章的分类页面该如何实现?
就是像普通的分类那样但是里面都是隐藏的文章
默认主题下,比如隐藏了第五篇文章,在第六篇文章的底部的“上一篇”会暴漏第五篇文章的链接。
个人只想在首页隐藏一些杂乱的文章
但是按照目前插件的功能,只能手动把除了index以外的所有generator都添加到public_generators
包括但不限于:tag, category, archive, sitemap, feed, xml, json, wordcount………对于其他人来说可能会更多
能否添加一个反选功能?
还是挺需要这个的qwq
我的配置:
# hexo-hide-posts
## https://github.com/prinsss/hexo-hide-posts
hide_posts:
enable: true
# 可以改成其他你喜欢的名字
filter: hidden
# 指定你想要传递隐藏文章的 generator,比如让所有隐藏文章在存档页面可见
# 常见的 generators 有:index, tag, category, archive, sitemap, feed, etc.
# 不常见的还有 xml (butterfly 主题的 hexo-generator-search 搜索,hexo-generator-searchdb 也是这个)
public_generators: [archive,category,tag,sitemap,baidusitemap,xml,feed]
# 为隐藏的文章添加 noindex meta 标签,阻止搜索引擎收录
noindex: false
Hexo 插件:
$ hexo -v
INFO Validating config
INFO
===================================================================
##### # # ##### ##### ###### ##### ###### # # #
# # # # # # # # # # # # #
##### # # # # ##### # # ##### # #
# # # # # # # ##### # # #
# # # # # # # # # # # #
##### #### # # ###### # # # ###### #
4.6.0
===================================================================
hexo: 6.3.0
hexo-cli: 4.3.0
os: win32 10.0.22621
node: 18.13.0
v8: 10.2.154.23-node.21
uv: 1.44.2
zlib: 1.2.13
brotli: 1.0.9
ares: 1.18.1
modules: 108
nghttp2: 1.51.0
napi: 8
llhttp: 6.0.10
uvwasi: 0.0.13
openssl: 3.0.7+quic
cldr: 42.0
icu: 72.1
tz: 2022f
unicode: 15.0
ngtcp2: 0.8.1
nghttp3: 0.7.0
隐藏文章(NSFW):https://www.pil0txia.com/post/2022-12-09_chatgpt-teach-stable-diffusion-nsfw/
使用 hexo-generator-feed 生成的atom:https://www.pil0txia.com/atom.xml
期待您的回复,谢谢
When some posts need to show as plain text, layout is disabled. It may be lack of tags for this plugin. Can this be solved with some tricks or work around?
I thought that hidden posts would not be visible even locally (when you do hexo s
), but actually they do, so I thought there was a bug with this plguin. But it seems that when I push my posts online, they do get hidden in a good way.
So I suggest you write this clearly in the document, or more people might get confused. It's a feature, not a bug ;-)
I suppose it's not to difficult to hide post completely and disallow direct access for private post.
Of cause, it will only be accessible via source file - but that's what we really mean by "private".
Otherwise, it will get into sitemap, search engines and etc. And will leak to public.
➜ hexo hexo g
INFO Start processing
INFO 2 posts are marked as hidden
WARN categories/index.html won't be rendered.
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
TypeError: Cannot read property 'bind' of undefined
at Hexo. (/home/haoyue/文档/Web/hexo/node_modules/hexo-hide-posts/index.js:59:30)
请问是哪里有错误呢???
我的hexo 版本是4.2的
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.