在终端powershell下,确保此时是在hexo目录下,命令行输入

1
hexo new page tags //新建tags页面

然后会在hexo下的source目录看到tags文件夹,在index.md里输入

1
2
3
4
5
6
---
title: tags
date: 2020-01-10 16:14:33
type: "tags"
layout: "tags" #增加tags的布局
---

然后再用同样的方法,新建一个categories

1
hexo new page categories //新建categories页面

然后配置categories 文件夹下的index.md

1
2
3
4
5
6
---
title: categories
date: 2020-01-10 16:15:43
type: "categories"
layout: "categories" #增加categories的布局
---

给自己的帖子新加配置,增加tags和categories

1
2
3
4
5
6
---
title: hexo categories和tags页面不显示解决办法
date: 2020-01-12 17:22:40
tags: 前端
categories: Hexo
---

进入主题/layout目录下,看看有没有categories.swig和tags.swig模板文件,没有则新建这两个文件