Skip to content

Instantly share code, notes, and snippets.

@destroytoday
Created October 16, 2011 17:29
Show Gist options
  • Save destroytoday/1291168 to your computer and use it in GitHub Desktop.
Save destroytoday/1291168 to your computer and use it in GitHub Desktop.
Month-separated blog post list in Jekyll w/ Liquid
---
layout: default
title: All Posts
category: blog
---
<div id="blog">
<h2>{{page.title}}</h2>
{% for post in site.categories.blog %}
{% capture post_month %}{{post.date | date: "%m"}}{% endcapture %}
{% if post_month != prev_post_month %}{% if prev_post_month %}</ol>{% endif %}<h3>{{post.date | date: "%B %Y"}}</h3><ol class="blog-list">{% endif %}
{% include blog-list-post.html %}
{% capture prev_post_month %}{{post_month}}{% endcapture %}
{% endfor %}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment