Index generator for Hexo.
npm install hexo-generator-index


Index generator for [Hexo].
It generates an archive of posts on your homepage, according to the index or archive layout of your theme.
``bash`
npm install hexo-generator-index --save
Add or modify the following section to your root _config.yml file.
`yaml`
index_generator:
path: ""
per_page: 10
order_by: -date
pagination_dir: page
layout: ["index", "archive"]
- path: Root path for your blog's index page.
- default: ""config.per_page
- per_page: Posts displayed per page.
- default: as specified in the official Hexo docs (if present), otherwise 100
- disables pagination.-date
- order_by: Posts order.
- default: (date descending)page
- pagination_dir: URL format.
- default: awesome-page
- e.g. set makes the URL ends with awesome-page/ for second page and beyond.["index", "archive"]
- layout: custom layout.
- defalut:
The sticky parameter in the post Front-matter will be used to pin the post to the top of the index page. Higher sticky means that it will be ranked first.
`yml`
---
title: Hello World
date: 2013/7/13 20:46:25
sticky: 100
---
If your theme define a non-archive index layout (e.g. About Me page), this plugin would follow that layout instead and not generate an archive. In that case, use hexo-generator-archive to generate an archive according to the archive` layout.
MIT
[Hexo]: https://hexo.io/