404 页面无法使用固定链接:使用 GitHub Pages + Jekyll 非常好

404 page not working with permalink: pretty using GitHub Pages + Jekyll

在我的 config.yml 中,我将永久链接设置为漂亮:

permalink: pretty

当我执行此操作时,出现 404 错误时,我的 404.html 页面不再显示在我的网站上(托管在 GitHub 页面上)。我该如何解决这个问题?

您需要做的是将此添加到 404.html 文件的前面:

---
permalink: /404.html
---

https://help.github.com/articles/creating-a-custom-404-page-for-your-github-pages-site/