-
Notifications
You must be signed in to change notification settings - Fork 0
/
posts-by-year.html
36 lines (32 loc) · 1.1 KB
/
posts-by-year.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
30
31
32
33
34
35
36
---
title: "Posts by Year"
permalink: /posts-by-year/
layout: archive
author_profile: false
---
{% assign postsByYear = site.posts | where_exp: "item", "item.hidden != true" | group_by_exp: 'post', 'post.date | date:
"%Y"' %}
{% for year in postsByYear %}
<ul class="taxonomy__index" id="{{ year.name }}">
<li>
<a href="{{ year.name | relative_url }}">
<strong>{{ year.name }}</strong> <span class="taxonomy__count">{{ year.items | size }}</span>
</a>
</li>
</ul>
{% assign postsByYearMonth = year.items | where_exp: "item", "item.hidden != true" | group_by_exp: 'post', 'post.date |
date: "%Y-%m"' %}
<ul class="taxonomy__index">
{% for yearMonth in postsByYearMonth %}
<li>
<a href="{{ yearMonth.name | replace: '-', '/' | relative_url }}">
<strong>{{ yearMonth.name }}</strong> <span class="taxonomy__count">{{ yearMonth.items | size }}</span>
</a>
</li>
{% endfor %}
</ul>
<div class="back-to-top-container">
<a href="#page-title" class="back-to-top">BACK TO TOP ↑</a>
<a href="#{{ year.name }}" class="back-to-top">BACK TO {{ year.name }} ↑</a>
</div>
{% endfor %}