layout: blog
<h2>Archive</h2> {% assign postsByMonth = site.posts | group_by_exp:“post”, “post.date | date: '%B %Y'” %} {% for yearMonth in postsByMonth %}
<h5 id="{{ yearMonth.name }}">{{ yearMonth.name }}</h5> <ul class="archive-list"> {% for post in yearMonth.items %} <li><a href="{{ post.url }}">{{ post.title }}</a></li> {% endfor %} </ul>
{% endfor %}