为 post 的 Front-matter 中添加 archive 选项用于决定 post 是否在首页展示(默认仍为展示) #869
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
这里是 issue #864 的pull request。
写作过程中,我们常常遇见由于内容过多导致某个主题变成系列文章的情况,往往一个系列还包含5篇以上的文章,如果全部罗列在首页显然不是一个优雅的做法。
私以为一个优雅的解决办法是为系列文章创建一个索引 post,在启用 category_bar 的同时为索引 post 中添加同系列每篇文章的url,首页上只展示每个系列的索引 post 即可。为此,我重写并覆盖了 hexo 的 hexo-generator-index 插件(说是重写也就是做了几处修改),同时在 post_fliter 处将主页文章这一分类过滤出来。
考虑到兼容性,archive 默认关闭,不影响原有 post 渲染。