我最近开始使用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>
我面临的问题是这个。应该托管此帖子页面的网址http://s-bhatt.github.io/2017/12/25/shivang-bhatt-site-launched正在提供404 - 找不到文件。
我非常感谢有关此问题的任何帮助或指示。
答案 0 :(得分:0)
答案 1 :(得分:0)
在您的_config.yml
中设置了永久链接:
permalink: /post/:year/:month/:day/:title
因此,根据帖子的文件名约定,2017-12-25-shivang-bhatt-site-launched.md
将位于http://s-bhatt.github.io/post/2017/12/25/shivang-bhatt-site-launched,即位于帖子文件夹中。
如果您想使用您尝试的网址,只需从permalink
移除发布,例如:
permalink: /:year/:month/:day/:title