Hexo博客生成标签和分类页

标签页

默认情况下,Hexo站点创建后,需手动生成标签页。如不生成,在点击“标签”菜单时会出现以下错误:

1
Cannot GET /tags/

执行以下命令创建标签页:

1
hexo new page tags

以上命令会在站点下生成页面source/tags/index.md。打开并编辑该页面,内容如下:

1
2
3
4
5
---
title: 标签
date: 2024-12-17 23:27:10
type: tags
---

以上内容的重点是设置页面type的值为tags。

分类页

同标签页,创建命令如下:

1
hexo new page categories

编辑source/categories/index.md内容如下:

1
2
3
4
5
---
title: 分类
date: 2024-12-17 23:54:38
type: categories
---