Hexo Auto Category Save

Generate categories automatically for each post in Hexo

Project README

Installation | ⚙️Configuration | 🤗Demo | 📖CN中文 |

hexo-auto-category

Hexo plugin, which generates categories automatically from folder structure for each post.

Installation

$ npm install hexo-auto-category --save

Configuration

You can configure this plugin in Hexo _config.yml

# Generate categories from directory-tree
# Dependencies: https://github.com/xu-song/hexo-auto-category
# depth: the max_depth of directory-tree you want to generate, should > 0
# multiple: multiple category hierarchies
auto_category:
 enable: true
 multiple: false
 depth: 

build & preview

$ hexo clean && hexo g && hexo s

Example

The generated categories for post source/_post/web/framework/hexo.md is as follows:

categories:
  - web
  - framework

If you set multiple: true, the generated categories for post source/_post/web/framework/hexo.md is as follows:

categories:
  - - web
  - - framework

See more information about multiple category:

https://hexo.io/docs/front-matter.html#Categories-amp-Tags

Demo

All the categories in ESON's Blog are generated automatically by hexo-auto-category.

Background

As a Hexo user, you must be troubled with front matter setting for each post. With this plugin, you don't need to set categories one by one. hexo-auto-category generates static post categories automatically based on directory/folder name.

Warning

Your original categories will be overwriten.

Open Source Agenda is not affiliated with "Hexo Auto Category" Project. README Source: xu-song/hexo-auto-category
Stars
94
Open Issues
4
Last Commit
4 months ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating