-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchive.html
54 lines (54 loc) · 1.92 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
---
layout: default
title: 文章
permalink: /archive/
keywords:
- blog
- archive
---
<div class="page-header">
<div class="tabbable tabs-left">
<ul class="nav nav-tabs">
{% capture post_year1 %}{{ 'now' }}{% endcapture %}
{% capture first_year %}{{ site.posts.first.date | date: '%Y' }}{% endcapture %}
{% for years in site.posts %}
{% capture post_year %}{{ years.date | date: '%Y' }}{% endcapture %}
{% if post_year1 != post_year %}
{% assign post_year1 = post_year %}
{% if first_year == post_year %}
<li class="active"><a href="#{{ post_year }}" data-toggle="tab">{{ post_year }}</a></li>
{% else %}
<li class=""><a href="#{{ post_year }}" data-toggle="tab">{{ post_year }}</a></li>
{% endif %}
{% endif %}
{% endfor %}
</ul>
{% capture post_year_month1 %}{{ 'now' }}{% endcapture %}
<div class="tab-content">
{% for post in site.posts %}
{% capture post_year_month2 %}{{ post.date | date: '%Y' }}{% endcapture %}
{% if post_year_month1 != post_year_month2 %}
{% if first_year == post_year_month2 %}
<div class="tab-pane active" id="{{ post_year_month2 }}">
{% else %}
<div class="tab-pane" id="{{ post_year_month2 }}">
{% endif %}
{% endif %}
{% if post_year_month1 != post_year_month2 %}
{% for list in site.posts %}
{% capture post_year_month3 %}{{ list.date | date: '%Y' }}{% endcapture %}
{% if post_year_month2 == post_year_month3 %}
<p><a href="{{ list.url }}">{{ list.title }}</a></p>
{% endif %}
{% endfor %}
{% endif %}
{% if post_year_month1 != post_year_month2 %}
{% assign post_year_month1 = post_year_month2 %}
{% assign post_year_month3 = nil %}
</div>
{% endif %}
{% endfor %}
</div>
</div>
</div>
<script src="/assets/js/bootstrap-tab.js"></script>