No output from for loop in index.html
Closed this issue · 2 comments
tomgenoni commented
Running jekyll build --watch
at the root of this repo doesn't evaluate the for loop in the /index.html
file.
It just passes:
{% for post in site.posts %}
<li><span>{{ post.date | date_to_string }}</span> » <a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
into the _site/index.html file.
Did I miss a step? I'd like to output a nested navigation reflecting the directory structure.
bbakersmith commented
Sorry about that, this was an issue with the default layout file, not the plugin.
index.html wasn't being rendered properly because the default layout used {{ page.content }}
. I created a separate sub-layout for pages and returned the default layout to {{ content }}
. I also removed the loop because there are no posts in this repo, but you can see the title tag is being properly evaluated now.
tomgenoni commented
Thanks. I was able to use with some generic content.
{% for page in site.pages %}
<li><a href="{{ page.url }}">{{ page.title }}</a></li>
{% endfor %}