npm

Need private packages and team management tools?Check out npm Orgs. »

hexo-directory-category

1.0.7 • Public • Published

hexo-directory-category

Build Status Coverage Status NPM Version npm downloads GitHub release

Automatically add front-matter categories to Hexo article according to the article file directory.

Directory is means relative form article file path to Hexo source _posts folder.

Features

  • See the details in hexo-theme-Wikitten issues#4
  • Automatically add category to article according to the file directory, if article front-matter haven't option categories.
  • Easy to categorize articles, or change the categories.

Install

$ cd <your-hexo-site>
$ npm install --save hexo-directory-category

Options

You can configure this plugin in site _config.yml.

auto_dir_categorize:
    enable: true  # options:true, false; default is true
    force: false # options:true, false; default is false
  • enable - Enable the plugin. Defaults to true.
  • force - Overwrite article front-matter categories, even if it has option categories.Defaults to false.

Example

1. enable: true, force: false

# file: ./_posts/Linux/Vim/note/test.md 
...
categories: [CS, Usage]
tags: [...]
 
# After hexo generate, it will nothing Conversion. categories: [CS, Usage] 
# file: ./_posts/Linux/Vim/note/test.md 
...
# categories: [...] 
tags: [...]
 
# After hexo generate, it will convert to categories: [Linux, Vim, note] 

2. enable: true, force: true

# file: ./_posts/Linux/Vim/note/test.md 
...
categories: [CS, Usage]
tags: [...]
 
# After hexo generate, it also will convert to categories: [Linux, Vim, note] 

License

MIT LICENSE

install

npm i hexo-directory-category

Downloadsweekly downloads

41

version

1.0.7

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability