Skip to content

Commit 7b41af7

Browse files
1 parent d2ac9f8 commit 7b41af7

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

_layouts/archives.html

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
layout: page
3+
# The Archives of posts.
4+
---
5+
6+
{% include lang.html %}
7+
8+
{% assign df_strftime_m = site.data.locales[lang].df.archives.strftime | default: '/ %m' %}
9+
{% assign df_dayjs_m = site.data.locales[lang].df.archives.dayjs | default: '/ MM' %}
10+
11+
<div id="archives" class="pl-xl-3">
12+
{% for post in site.posts %}
13+
{% assign cur_year = post.date | date: '%Y' %}
14+
15+
{% if cur_year != last_year %}
16+
{% unless forloop.first %}</ul>{% endunless %}
17+
18+
<time class="year lead d-block">{{ cur_year }}</time>
19+
{{ '<ul class="list-unstyled">' }}
20+
21+
{% assign last_year = cur_year %}
22+
{% endif %}
23+
24+
<li>
25+
{% assign ts = post.date | date: '%s' %}
26+
<span class="date day" data-ts="{{ ts }}" data-df="MM / DD">{{ post.date | date: '%m / %d' }}</span>
27+
<!--span class="date month small text-muted ms-1" data-ts="{{ ts }}" data-df="{{ df_dayjs_m }}">
28+
{{ post.date | date: df_strftime_m }}
29+
</span-->
30+
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
31+
</li>
32+
33+
{% if forloop.last %}
34+
</ul>{% endif %}
35+
{% endfor %}
36+
</div>

0 commit comments

Comments
 (0)