Hexo隐藏文档
前言
用的插件,且插件的文档写的很好了
下面是搬运的内容
安装
sh
npm install hexo-generator-index2 --save
npm uninstall hexo-generator-index --save
hexo-generator-index2可以完全替代官方的hexo-generator-index,所以安装之后,先卸载官方的插件,不然会引起一些冲突。
选项
yml
# index2 generator是否包含官方的hexo-generator-index,默认true(包含)
index2_include_index: true # defult is true
# 配置index2 generator,可以是数组或对象
index2_generator:
per_page: 10
order_by: -date
include:
- category Web # 只包含Web分类下的文章
exclude:
- tag Hexo # 不包含标签为Hexo的文章
per_page: Posts displayed per page. (0 = disable pagination)
order_by: Posts order. (Order by date descending by default)
layout: Set the layout, default is index
path: Output path, if path is '', means output to the root directory (http://127.0.0.1:4000/ )
index: Home index or not, if true and the path is '', same to offical hexo-generator-index
include: Posts filter include option
exclude: Posts filter exclude option
除了include和exclude,其它如per_page和order_by都是原有的官方首页生成器选项,不必更改。
Include/exclude 选项格式为属性 值(注意,属性与值中间有个英文的空格),可选的属性有:
category: 文章分类
tag: 文章标签
path: 文章源路径