-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchive.html
More file actions
36 lines (33 loc) · 967 Bytes
/
archive.html
File metadata and controls
36 lines (33 loc) · 967 Bytes
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
---
layout: default
title: Archive
permalink: /archive/
description: "Complete archive of all blog posts by Yaodong Zhao, organized by year."
---
{% assign posts = site.posts | sort: "created_date" | reverse %}
{% assign posts_by_year = posts | group_by_exp: "post", "post.created_date | date: '%Y'" %}
<section class="content-card">
<header class="mb-8">
<h1>Archive</h1>
<p class="meta mt-2">{{ posts.size }} posts</p>
</header>
{% if posts.size > 0 %}
{% for year in posts_by_year %}
<h2 class="archive-year">{{ year.name }}</h2>
<ul>
{% for post in year.items %}
<li class="post-item">
<a href="{{ post.url | relative_url }}">
{{ post.title }}
</a>
<time datetime="{{ post.created_date | date: '%Y-%m-%d' }}">
{{ post.created_date | date: "%b %d" }}
</time>
</li>
{% endfor %}
</ul>
{% endfor %}
{% else %}
<p class="meta">No posts published yet.</p>
{% endif %}
</section>