Skip to content

Latest commit

 

History

History
63 lines (45 loc) · 2.67 KB

README_zh.md

File metadata and controls

63 lines (45 loc) · 2.67 KB

Build Status node npm downloads npm version GitHub release

简介

带过滤功能的Hexo首页生成器插件。在官方的首页生成器基础上添加了过滤指定分类/标签的功能。比如,在首页只显示指定分类下面的文章列表。 除此之外,它还在指定的目录下生成指定类型的文章,比如在web目录下生成Web相关的文章。

English

安装

$ npm install hexo-generator-index2 --save
$ npm uninstall hexo-generator-index --save

hexo-generator-index2可以完全替代官方的hexo-generator-index,所以安装之后,先卸载官方的插件,不然会引起一些冲突。

选项

# 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_pageorder_by都是原有的官方首页生成器选项,不必更改。

Include/exclude 选项格式为属性 值(注意,属性与值中间有个英文的空格),可选的属性有:

  • category: 文章分类
  • tag: 文章标签
  • path: 文章源路径

License

MIT