This might be a bit late but I just had a similar issue.
I originally had this in my default.html
---
page.title: My Blog
---
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{{ page.title }} | My Blog - Musings of a Software Developer from Norwich</title>
<link rel="stylesheet" href="{{'/assets/main.css' | prepend: site.baseurl}}">
</head>
<body>
{% include nav.html %}
<div class="content">
{{ page.content }}
</div>
<script src="{{'/node_modules/jquery/dist/jquery.min.js' | prepend: site.baseurl}}"></script>
<script src="{{'/node_modules/popper.js/dist/popper.min.js' | prepend: site.baseurl}}"></script>
<script src="{{'/node_modules/bootstrap/dist/js/bootstrap.min.js' | prepend: site.baseurl}}"></script>
</body>
</html>
and in my blog.html, I had
---
title: Blog
layout: default
---
<h1>Latest Posts</h1>
<ul>
{% for post in site.posts %}
<li>
<a href="{{ post.url }}">{{ post.title }}</a>
</li>
{% endfor %}
</ul>
Answer
I noticed that when I removed the layout from the frontmatter, then the loop was running correctly, so I put my layout back in and it stopped working. Then on closer comparison with another site I was doing, I noticed in my layout I had {{ page.content }}
. So I updated this to just be {{ content }}
and hey presto, I got my theme and it looping over the blog posts like I wanted it too. Hopefully this might help someone in the future