Search code examples
jekyllgithub-pages

md (markdown) pages giving 404


I've recently started using GitHub pages and I'm facing the following issue. As you can see in my repository, I have a _posts to store my blog markdowns. I have used the naming convention of YYYY-MM-DD-title-of-my-post.md. Now, as you can see with 2017-12-25-shivang-bhatt-site-launched.md, the content inside is as follows:

---
layout: post
title: "Shivang Bhatt, Launches Site"
date: 2017-12-25
---

Well...some text.

Now for the layout part of this, my _layouts contains a post.html with the following content:

---
layout: default
---
<h1>{{ page.title }}</h1>
<p class="meta">{{ page.date | date_to_string }}</p>

<div class="post">
  {{ content }}
</div>

The issue I am facing is this. The URL which should host this post page, http://s-bhatt.github.io/2017/12/25/shivang-bhatt-site-launched, is giving a 404 - File not found.

I would be extremely grateful for any help or pointers regarding this issue.


Solution

  • In your _config.yml you have set the permalink:

    permalink: /post/:year/:month/:day/:title
    

    so following the filename convention for posts, 2017-12-25-shivang-bhatt-site-launched.md will be at http://s-bhatt.github.io/post/2017/12/25/shivang-bhatt-site-launched, that is, inside the post folder.

    If you want to make it work with the url you tried, just remove post from permalink like:

    permalink: /:year/:month/:day/:title