-
Notifications
You must be signed in to change notification settings - Fork 1
/
archive.html
42 lines (40 loc) · 1.1 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
---
layout: default
title: Archives
---
{%for post in site.posts %}
{% unless post.next %}
<div class="card">
<div class="card-header">
<p class="title">{{ post.date | date: '%Y' }}</p>
</div>
<ul class="posts">
{% else %}
{% capture year %}{{ post.date | date: '%Y' }}{% endcapture %}
{% capture nyear %}{{ post.next.date | date: '%Y' }}{% endcapture %}
{% if year < "2018" %}
{% assign year = "Anciens" %}
{% endif %}
{% if nyear < "2018" %}
{% assign nyear = "Anciens" %}
{% endif %}
{% if year != nyear %}
</ul>
</div>
<div class="card">
<div class="card-header">
<p class="title">{{ year }}</p>
</div>
<ul class="posts">
{% endif %}
{% endunless %}
{% assign monthIndex = post.date | date: '%m' | minus: 1 %}
<li>
<p>
{{ post.date | date: '%d' }} {{ site.data.en.months[monthIndex] }} - <a
href="{{ site.url}}{{ post.url }}">{{ post.title }}</a>
</p>
</li>
{% endfor %}
</ul>
</div>