Skip to content
Index generator plugin for Hexo.
JavaScript
Branch: master
Clone or download

README.md

hexo-generator-indexed

npm-image lic-image

Index generator for Hexo.

It generates an archive of posts on your homepage, according to the index or archive layout of your theme.

Installation

size-image dm-image dt-image

$ npm install hexo-generator-indexed

Options

Add or modify the following section to your root _config.yml file

index_generator:
  path: ''
  per_page: 10
  order_by: -date
  pagination_dir: page
  • path: Root path for your blog's index page.
    • default: ""
  • per_page: Posts displayed per page.
    • default: config.per_page as specified in the official Hexo docs (if present), otherwise 10
    • 0 disables pagination
  • order_by: Posts order.
    • default: date descending
  • pagination_dir: URL format.
    • default: 'page'
    • awesome-page makes the URL ends with 'awesome-page/' for second page and beyond.

Note

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.

Feature & Usage

置顶文章 Pinned article

在文章的Front-matter中增加一个sticky参数用来置顶,其值应为大于0的整数,表示置顶的优先级(未指定则默认为0)。数字越大,文章越靠前。
Add a sticky parameter to the the post's Front-matter to make the post pinned at the top of home page.

---
title: example
sticky: 100
---

采用sticky关键词是因为这个在NexT主题中已经定义了置顶样式,因此可以直接拿来使用。

隐藏文章 Hide article

在文章的Front-matter中增加一个hide参数用来隐藏。
Add a hide parameter to the the post's Front-matter to hide the post from home page.

---
title: example
hide: true
---

隐藏特定分类中的文章 Hide articles in specified categories

在Hexo的_config.yml中可以通过hide_categories选项设置隐藏某个分类下的文章,例如:
You can hide articles in specified categories by setting hide_categories in hexo _config.yml, e.g.

hide_categories:
  - categorie1
  - categorie2

License

MIT

You can’t perform that action at this time.