Hexo博客搭建(5)——自定义Hexo文件
语言
修改站点配置文件 _config.yml
默认语言是 en
主题支持三种语言
- default(en)
- zh-CN (简体中文)
- zh-TW (繁体中文)
网站资料
修改网站各种资料,例如标题、副标题和邮箱等个人资料,请修改博客根目录的_config.yml
1 | # Site |
配置分类页
新建分类categories 页
categories
页是用来展示所有分类的页面,如果在你的博客source
目录下还没有categories/index.md
文件,那么你就需要新建一个,命令如下:1
hexo new page "categories"
编辑刚刚新建的页面文件
/source/categories/index.md
,至少需要以下内容:1
2
3
4
5
6---
title: categories
date: 2023-07-21 00:57:33
type: "categories"
layout: "categories"
---新建标签tags页
tags
页是用来展示所有标签的页面,如果在你的博客source
目录下还没有 tags/index.md 文件,那么你就需要新建一个,命令如下:1
hexo new page "tags"
编辑你刚刚新建的页面文件
/source/tags/index.md
,至少需要以下内容:1
2
3
4
5
6---
title: tags
date: 2023-07-21 00:57:33
type: "tags"
layout: "tags"
---新建关于我about页
同上,秩序把相关信息改成
about
新建留言板contact页(可选)
同上,秩序把相关信息改成
about
新建友情链接friends页(可选)
同上,秩序把相关信息改成
about
同时,在你的博客
source
目录下新建 _data 目录,在_data
目录中新建friends.json
文件,文件内容如下所示:1
2
3
4
5
6
7
8[{
"avatar": "",
"name": "",
"introduction": "",
"url": "",
"title": ""
}
]新建404页
同上,秩序把相关信息改成
about
编辑你刚刚新建的页面文件
/source/404/index.md
,至少需要以下内容:1
2
3
4
5
6
7---
title: 404
date: 2018-09-30 17:25:30
type: "404"
layout: "404"
description: "Oops~,我崩溃了!找不到你想要的页面 :("
---
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 ZYH's blog!
评论