2
votes

I am setting up a Github Pages site and the index.html, css, etc are all working fine.

When I create a .md file in _posts using the syntax YYYY-MM-DD-title-of-post.md, I can navigate to username.github.io/YYYY/MM/DD/title-of-post and not get a 404, but it only shows the contents of my index.html file.

Here's the link to the gh-p: https://jacobkreider.github.io

And a sample of the issue: https://jacobkreider.github.io/2018/06/12/try-again

Why would this happen? Is there a redirect or something in there I don't know about? I am publishing via the web interface, but get the same issue from Desktop, as well as the command line.

I see the same thing when I try and load the index file from my /blog/ folder (to try and see a list of published posts).

I'm stuck- any help would be much appreciated.

EDIT: It appears it is just showing my default layout under the _layouts folder. Changes to index.html or additional file posts aren't shown anywhere.

2

2 Answers

2
votes

I looked at the repo for your site. You have the same block of code <div class="blurb"> ... </div> in /index.html and in /_layouts/default.html. You only need this code in /index.html.

In /_layouts/default.html, replace that div with {{ content }} so that it looks like

...
</nav>
<div class="container">
    {{ content }}
</div><!-- /.container -->
<footer>
...

Since you specified layout: default in the front matter in /index.html, Jekyll uses the /_layouts/default.html, stores the actual content of /index.html in the content variable, and inserts all that stuff into the layout using {{ content }}. Since you're missing {{ content }}, that's why none of your changes to posts or /index.html are showing up.

0
votes

Your default layout doesn't output {{ content }}. Edit this file to read :

...
<div class="container">
  {{ content }}
</div>
...