md (markdown) 页面给出 404
md (markdown) pages giving 404
我最近开始使用 GitHub 页面,但遇到了以下问题。正如您在我的 repository 中看到的,我有一个 _posts
来存储我的博客降价。我使用了 YYYY-MM-DD-title-of-my-post.md
的命名约定。
现在用2017-12-25-shivang-bhatt-site-launched.md
可以看到,里面的内容如下:
---
layout: post
title: "Shivang Bhatt, Launches Site"
date: 2017-12-25
---
Well...some text.
现在对于布局部分,我的 _layouts
包含具有以下内容的 post.html
:
---
layout: default
---
<h1>{{ page.title }}</h1>
<p class="meta">{{ page.date | date_to_string }}</p>
<div class="post">
{{ content }}
</div>
我面临的问题是这样的。本应托管此 post 页面的 URL http://s-bhatt.github.io/2017/12/25/shivang-bhatt-site-launched 给出了 404 - 未找到文件。
对于有关此问题的任何帮助或指示,我将不胜感激。
正确的地址是
http://s-bhatt.github.io/post/2017/12/25/shivang-bhatt-site-launched
注意中间的/post
。
在您的 _config.yml
中,您设置了永久链接:
permalink: /post/:year/:month/:day/:title
所以按照 posts 的文件名约定,2017-12-25-shivang-bhatt-site-launched.md
将位于 http://s-bhatt.github.io/post/2017/12/25/shivang-bhatt-site-launched,即 post 文件夹。
如果您想让它与您尝试过的 url 一起使用,只需从 permalink
中删除 post,例如:
permalink: /:year/:month/:day/:title
我最近开始使用 GitHub 页面,但遇到了以下问题。正如您在我的 repository 中看到的,我有一个 _posts
来存储我的博客降价。我使用了 YYYY-MM-DD-title-of-my-post.md
的命名约定。
现在用2017-12-25-shivang-bhatt-site-launched.md
可以看到,里面的内容如下:
---
layout: post
title: "Shivang Bhatt, Launches Site"
date: 2017-12-25
---
Well...some text.
现在对于布局部分,我的 _layouts
包含具有以下内容的 post.html
:
---
layout: default
---
<h1>{{ page.title }}</h1>
<p class="meta">{{ page.date | date_to_string }}</p>
<div class="post">
{{ content }}
</div>
我面临的问题是这样的。本应托管此 post 页面的 URL http://s-bhatt.github.io/2017/12/25/shivang-bhatt-site-launched 给出了 404 - 未找到文件。
对于有关此问题的任何帮助或指示,我将不胜感激。
正确的地址是
http://s-bhatt.github.io/post/2017/12/25/shivang-bhatt-site-launched
注意中间的/post
。
在您的 _config.yml
中,您设置了永久链接:
permalink: /post/:year/:month/:day/:title
所以按照 posts 的文件名约定,2017-12-25-shivang-bhatt-site-launched.md
将位于 http://s-bhatt.github.io/post/2017/12/25/shivang-bhatt-site-launched,即 post 文件夹。
如果您想让它与您尝试过的 url 一起使用,只需从 permalink
中删除 post,例如:
permalink: /:year/:month/:day/:title