-
Notifications
You must be signed in to change notification settings - Fork 0
/
archives.html
61 lines (57 loc) · 1.56 KB
/
archives.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
layout: default
title: Archives
sitemap:
priority: 1
changefreq: daily
---
<ul class="postList archive">
{% for post in site.posts %}
{% if post.next %}
{% capture year %}{{ post.date | date: '%Y' }}{% endcapture %}
{% capture nyear %}{{ post.next.date | date: '%Y' }}{% endcapture %}
{% capture month %}{{ post.date | date: '%B' }}{% endcapture %}
{% capture nmonth %}{{ post.next.date | date: '%B' }}{% endcapture %}
{% endif %}
{% if forloop.first %}
<!-- year -->
<li class="box"><h1 id="{{ post.date | date: '%Y' }}">{{ post.date | date: '%Y' }}</h1>
<ul>
<!-- month -->
<li><h2 id="{{ post.date | date: '%Y-%B' }}">{{ post.date | date: '%B' }}</h2>
<ul>
{% else %}
<!-- all other posts-->
{% if year != nyear %}
</ul>
</li>
<!-- /month -->
</ul>
</li>
<!-- /year -->
<!-- year -->
<li class="box"><h1 id="{{ post.date | date: '%Y' }}">{{ post.date | date: '%Y' }}</h1>
<ul>
<!-- month -->
<li><h2 id="{{ post.date | date: '%Y-%B' }}">{{ post.date | date: '%B' }}</h2>
<ul>
{% elsif month != nmonth %}
</ul>
</li>
<!-- /month -->
<!-- month -->
<li><h2 id="{{ post.date | date: '%Y-%B' }}">{{ post.date | date: '%B' }}</h2>
<ul>
{% endif %}
{% endif %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% if forloop.last %}
</ul>
</li>
<!-- /month -->
</ul>
</li>
<!-- /year -->
{% endif %}
{% endfor %}
</ul>