一、配置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