Skip to content

Instantly share code, notes, and snippets.

@mickmaccallum
Last active August 29, 2015 14:18
Show Gist options
  • Save mickmaccallum/589c6c177f9a502dec66 to your computer and use it in GitHub Desktop.
Save mickmaccallum/589c6c177f9a502dec66 to your computer and use it in GitHub Desktop.
Jekyll posts by category with HTML description list (dl)
<section class="posts">
{% for category in site.categories %}
<dl>
<dt>
{{ category | first | capitalize }}
</dt>
{% for posts in category %}
{% for post in posts %}
{% if post.url %}
<dd>
<a class="post-link" href="{{ post.url }}">
{{ post.title }}
</a>
</dd>
{% endif %}
{% endfor %}
{% endfor %}
</dl>
{% endfor %}
</section>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment