-
Notifications
You must be signed in to change notification settings - Fork 5
/
archive.html
29 lines (26 loc) · 916 Bytes
/
archive.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
---
layout: default
title: Archive
description: All posts sorted by published date
---
<div class="archive">
<h1>{{ page.title | escape }}</h1>
{%- assign archives = site.archives | reverse -%}
<div class="archive-year-summary">
{%- for archive in archives -%}
{%- if archive.type == "year" -%}
<a href="{{ archive.url }}">{{ archive.date | date: "%Y" }}({{ archive.posts.size }})</a><wbr />
{%- endif -%}
{%- endfor -%}
</div>
<div class="archive-month-summary">
{%- for archive in archives -%}
{%- if archive.type == "month" -%}
{%- assign this_year = archive.date | date: "%Y" -%}
{%- if previous_year != "" and previous_year != this_year -%}<br />{%- endif -%}
<a href="{{ archive.url }}">{{ archive.date | date: "%Y-%m" }}({{ archive.posts.size }})</a><wbr />
{%- assign previous_year = archive.date | date: "%Y" -%}
{%- endif -%}
{%- endfor -%}
</div>
</div>