Hexo博客如何添加404公益页面
1.在博客主页面菜单添加公益选项
以maupassant主题为例,编辑maupassant主题文件下的_config.yml
vim Blog/themes/maupassant_config.yml
编辑效果如下
menu:
- page: home
directory: .
icon: fa-home
- page: archive
directory: archives/
icon: fa-archive
- page: about
directory: about/
icon: fa-user
- page: 公益
directory: 404
icon: fa-heart
公益页面的位置随意填写不存在的目录地址即可;无须使用命令hexo new page创建公益页面的真实文件夹。
2.创建404.html
- 在博客根目录sourec文件夹下建立404.html
vim Blog/source/404.html
如果选择腾讯的404公益页面添加内容如下:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8;"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta