一、配置categories

1. 新建页面categories:

hexo new page "categories"

执行命令后将新生成文件夹categories,并在该文件夹下生成index.md文件。

2. 编辑categories/index.md文件:

vi {path}/source/categories/index.md

编辑内容:

---
title: 分类
date: 2017-10-25 22:00:00
type: "categories"
---

3. 编辑主题配置文件themes/next/_config.yml:

vi {path}/themes/next/_config.yml

menu中的categories的注释去掉:

menu:
     home: / || home
     #tags: /tags/ || tags
     categories: /categories/ || th
     archives: /archives/ || archive
     #about: /about/ || user
     #schedule: /schedule/ || calendar
     #sitemap: /sitemap.xml || sitemap
     #commonweal: /404/ || heartbeat

4. 编辑文章在Front-matter区域(即---分隔的区域)指定categories即可:

---
title: test
date: 2017-01-01 00:00:00
categories:
 - 类别名称
tags:
 - 标签
--- 

分类具有顺序性和层次性,而标签没有顺序和层次。

二、配置tags

1. 新建页面tags:

hexo new page "tags"

2. 编辑tags/index.md文件:

vi {path}/source/tags/index.md

编辑内容:

---
title: 标签
date: 2017-10-25 22:05:00
type: "tags"
---

3. 编辑主题配置文件themes/next/_config.yml:

vi {path}/themes/next/_config.yml

menu中的tags的注释去掉:

menu:
     home: / || home
     tags: /tags/ || tags
     categories: /categories/ || th
     archives: /archives/ || archive
     #about: /about/ || user
     #schedule: /schedule/ || calendar
     #sitemap: /sitemap.xml || sitemap
     #commonweal: /404/ || heartbeat

文章指定tags的写法与categories一致,在Front-matter区域指定即可,写法可参考以上。

三、配置about

1. 新建页面about:

hexo new page "about"

2. 编辑about/index.md文件,内容可根据个人编写;

vi {path}/source/about/index.md

3. 编辑主题配置文件themes/next/_config.yml:

vi {path}/themes/next/_config.yml

menu中的about的注释去掉:

menu:
     home: / || home
     tags: /tags/ || tags
     categories: /categories/ || th
     archives: /archives/ || archive
     about: /about/ || user
     #schedule: /schedule/ || calendar
     #sitemap: /sitemap.xml || sitemap
     #commonweal: /404/ || heartbeat
文章目录