Giter Site home page Giter Site logo

xu-song / hexo-auto-category Goto Github PK

View Code? Open in Web Editor NEW
96.0 4.0 8.0 41 KB

Generate categories automatically for each post in Hexo

Home Page: https://blog.eson.org/pub/e2f6e239/

License: MIT License

JavaScript 100.00%
hexo hexo-plugin category node-module folder-structure directory-tree

hexo-auto-category's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.