第一步:创建404.md
以前的方法是创建404.html,我尝试了,渲染好像有点问题。
于是在网上查询一些方法,是去创建md文件,在此做个总结,也结合了自己的想法。
首先,我们在blog目录的source文件下新建404.md文件,
404.md内容:
1 2 3 4 5
| --- title: 404 comments: false permalink: /404 ---
|
当然,具体内容可以自己写,可以参考我的:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| title: 404 comments: false permalink: /404 ---
<center>
## **Not Found**
对不起,您所访问的页面不存在或者已删除
[点击此处](https://fvccd.github.io/) `返回首页`
</center>
---
<center>
<span style="margin-left:22px; font-size:30px;color:red;background:#00ff00;">已隐藏</span>
</center>
|
第二步:配置修改
1 2 3 4 5 6 7 8 9 10 11
| menu: home: / || fa fa-home about: /about/ || fa fa-user tags: /tags/ || fa fa-tags categories: /categories/ || fa fa-th archives: /archives/ || fa fa-archive #schedule: /schedule/ || fa fa-calendar 留言: /guestbook/ || fa fa-comment #sitemap: /sitemap.xml || fa fa-sitemap 公益: /commonweal/ || fa fa-heartbeat 相册: /404/ || fa fa-image
|
比如,这里我想把相册界面404化,就在//中间加入404即可,图片就不放了,自行试试。
用途