hacks-guide-minimal-mistake.../test/_pages/year-archive.html
2018-01-05 20:47:34 -05:00

14 lines
No EOL
392 B
HTML

---
layout: archive
permalink: /year-archive/
title: "Posts by Year"
author_profile: true
---
{% assign postsByYear = site.posts | group_by_exp:"post", "post.date | date: '%Y'" %}
{% for year in postsByYear %}
<h2 id="{{ year.name | slugify }}" class="archive__subtitle">{{ year.name }}</h2>
{% for post in year.items %}
{% include archive-single.html %}
{% endfor %}
{% endfor %}