Skip to content

Instantly share code, notes, and snippets.

@davebowker
Created July 31, 2015 17:07
Show Gist options
  • Select an option

  • Save davebowker/21f0d54d8f29bfdfda19 to your computer and use it in GitHub Desktop.

Select an option

Save davebowker/21f0d54d8f29bfdfda19 to your computer and use it in GitHub Desktop.
Loop through all categories in your Jekyll Site.html
{% for category in site.categories %}
<div class="catbloc" id="{{ category | first | remove:' ' }}">
<h2>{{ category | first }}</h2>
<ul>
{% for posts in category %}
{% for post in posts %}
{% if post.url %}
<li>
<a href="{{ post.url }}">
<time>{{ post.date | date: "%-d %B %Y" }}</time>
{{ post.title }}
</a>
</li>
{% endif %}
{% endfor %}
{% endfor %}
</ul>
</div>
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment