-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy patharchives.html
97 lines (90 loc) · 3.01 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
---
layout: page
title: Archives
permalink: /archives/
---
<div class="tabbable tabs-right row-fluid">
<ul class="nav nav-tabs" id="archives-nav">
{% for post in site.posts order: record_on %}
{% capture current_year %}{{ post.record_on | date: "%Y" }}{% endcapture %}
{% capture previous_year %}{{ post.next.record_on | date: "%Y" }}{% endcapture %}
{% if forloop.first %}
<li>
<a href="#{{ current_year }}-ref" data-toggle="tab">
{{current_year}} 年
</a>
</li>
{% else %}
{% if previous_year != '' And previous_year != nil %}
{% if current_year != previous_year %}
<li>
<a href="#{{ current_year }}-ref" data-toggle="tab">
{{current_year}} 年
</a>
</li>
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
</ul>
<div class="tab-content">
{% for post in site.posts order: record_on %}
{% capture current_year %}{{ post.record_on | date: "%Y" }}{% endcapture %}
{% capture previous_year %}{{ post.next.record_on | date: "%Y" }}{% endcapture %}
{% if forloop.first %}
<div class="tab-pane" id="{{ current_year }}-ref">
<ul class="posts-list">
<li>
<span class="category-archive">
<a href="{{ post.url }}">{{ post.title }}</a>
</span>
<span class="post-right-info pull-right">
{{ post.record_on | date: " %Y 年 %m 月 %d 日" }}
</span>
</li>
{% elsif forloop.last %}
<li>
<span class="category-archive">
<a href="{{ post.url }}">{{ post.title }}</a>
</span>
<span class="post-right-info pull-right">
{{ post.record_on | date: " %Y 年 %m 月 %d 日" }}
</span>
</li>
</ul>
</div>
{% else %}
{% if previous_year != '' And previous_year != nil %}
{% if current_year != previous_year %}
</ul>
</div>
<div class="tab-pane" id="{{ current_year }}-ref">
<ul class="posts-list">
<li>
<span class="category-archive">
<a href="{{ post.url }}">{{ post.title }}</a>
</span>
<span class="post-right-info pull-right">
{{ post.record_on | date: " %Y 年 %m 月 %d 日" }}
</span>
</li>
{% else %}
<li>
<span class="category-archive">
<a href="{{ post.url }}">{{ post.title }}</a>
</span>
<span class="post-right-info pull-right">
{{ post.record_on | date: " %Y 年 %m 月 %d 日" }}
</span>
</li>
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
</div>
</div>
<script>
$(function () {
$('#archives-nav a:first').tab('show');
})
</script>