-
Notifications
You must be signed in to change notification settings - Fork 4
/
archive.html
63 lines (56 loc) · 2.12 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
layout: default
title: Archive
---
<article class="page-block">
<h2 class="post-title text-center">
<a href="{{ page.url | prepend: site.baseurl }}" class="inverse-noactive">{{ page.title }}</a>
</h2>
<div class="row">
<div class="col-md-3 hidden-xs">
<div class="center-block sidebar">
{% for post in site.posts %}
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %}
{% capture this_month %}{{ post.date | date: "%B" }}{% endcapture %}
{% capture prev_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %}
{% capture prev_month %}{{ post.previous.date | date: "%B" }}{% endcapture %}
{% if forloop.first %}
<ul class="archive-sidebar">
<li><a href="#{{this_year}}_{{this_month}}">{{this_month}} {{this_year}}</a></li>
{% endif %}
{% if forloop.last %}
</ul>
{% else %}
{% if this_year != prev_year or this_month != prev_month %}
<li><a href="#{{prev_year}}_{{prev_month}}">{{prev_month}} {{prev_year}}</a></li>
{% endif %}
{% endif %}
{% endfor %}
</div>
</div>
<div class="col-md-9 archive-content">
{% for post in site.posts %}
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %}
{% capture this_month %}{{ post.date | date: "%B" }}{% endcapture %}
{% capture prev_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %}
{% capture prev_month %}{{ post.previous.date | date: "%B" }}{% endcapture %}
{% if forloop.first %}
<h3 id="{{this_year}}_{{this_month}}" class="tag-title">{{this_month}} {{this_year}}</h1>
<ul class="tag-post-list">
{% endif %}
<a class="post-title" href="{{ site.baseurl }}{{ post.url }}">
<li><h4 class="post-title">{{ post.title }} <small class="post-date">{{ post.date | date_to_string }}</small></h4></li>
</a>
{% if forloop.last %}
</ul>
{% else %}
{% if this_year != prev_year or this_month != prev_month %}
</ul>
<h3 id="{{prev_year}}_{{prev_month}}" class="tag-title">{{prev_month}} {{prev_year}}</h1>
<ul class="tag-post-list">
{% endif %}
{% endif %}
{% endfor %}
</div>
</div>
</article>