~xdavidwu/xdavidwu.link

ref: 6c0144ff2935eb19f35937a016721dcfdcad2b9c xdavidwu.link/example/_pages/year-archive.html -rwxr-xr-x 489 bytes
6c0144ff — Michael Rose Merge branch 'release/4.0.4' 8 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
---
layout: archive
permalink: /year-archive/
title: "Posts by Year"
author_profile: true
---

{% include base_path %}
{% capture written_year %}'None'{% endcapture %}
{% for post in site.posts %}
  {% capture year %}{{ post.date | date: '%Y' }}{% endcapture %}
  {% if year != written_year %}
    <h2 id="{{ year | slugify }}" class="archive__subtitle">{{ year }}</h2>
    {% capture written_year %}{{ year }}{% endcapture %}
  {% endif %}
  {% include archive-single.html %}
{% endfor %}