1.在博客主頁面菜單添加公益選項(xiàng)
以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創(chuàng)建公益頁面的真實(shí)文件夾适贸。
2.創(chuàng)建404.html
- 在博客根目錄sourec文件夾下建立404.html
vim Blog/source/404.html
如果選擇騰訊的404公益頁面添加內(nèi)容如下:
<!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 name="robots" content="all" />
<meta name="robots" content="index,follow"/>
</head>
<body>
<script type="text/javascript" src="http://qzonestyle.gtimg.cn/qzone/hybrid/app/404/search_children.js" charset="utf-8" homePageUrl="http://lilibei.net" homePageName="回到我的主頁"></script>
</body>
</html>
注意:homePageUrl="your web site"處填寫你的博客地址佛析,如http://lilibei.net
如果選擇益云404公益頁面添加內(nèi)容如下:
<!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 name="robots" content="all" />
<meta name="robots" content="index,follow"/>
</head>
<body>
<iframe scrolling='no' frameborder='0' src='http://yibo.iyiyun.com/Home/Distribute/ad404/key/1355117' width='654' height='470' style='display:block;'></iframe>
</body>
</html>
益云404公益頁面自動(dòng)返回你的博客地址沿后,因此無須做其他更改刽锤。
最終效果如下镊尺,當(dāng)然也歡迎訪問我的博客查看。