hexo从零开始搭建博客(四):安装插件

hexo-auto-category

插件作用:根据目录生成对应的分类
需要已经添加 标签 页面

  • 添加 标签 页面
1
2

hexo new page categories
1
2
3
4
5
6
7
# 设置页面类型
# 添加: type: "categories"
---
title: 分类
date: 2015-01-01 00:00:00
type: "categories"
---
1
2
3
4
5
# 修改主题配置文件, 如: next/_config.yml
menu:
home: /
archives: /archives
categories: /categories
  • 安装
1
$ npm install hexo-auto-category --save
  • 修改站点配置文件
1
2
3
auto_category:
enable: true
depth:
  • 重新生成
1
hexo clean && hexo g && hexo s