forked from Duter2016/Duter2016.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
1archives.html
40 lines (35 loc) · 1.44 KB
/
1archives.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
---
layout: page
permalink: /archives/
title: "归 档"
description: "文章按日期分类归档!"
header-img: "img/post-bg-dutlx.jpg"
---
<ul>
<h4><font color="brown">数量统计(点击直达):</font></h4>
{% assign counter = 0 %}
{% for post in site.posts %}
{% assign thisyear = post.date | date: "%Y年" %}
{% assign prevyear = post.previous.date | date: "%Y年" %}
{% assign counter = counter | plus: 1 %}
{% if thisyear != prevyear %}
<li type="circle"><a href="#{{ post.date | date: '%Y年' }}">👉 <font color="brown">{{ thisyear }} 文章数量: {{ counter }} 篇;</font></a></li>
{% assign counter = 0 %}
{% endif %}
{% endfor %}
</ul>
<hr>
<ul>
{% for post in site.posts %}
{% unless post.next %}
<h2 id="{{ post.date | date: '%Y年'}}">{{ post.date | date: '%Y年' }}</h2>
{% else %}
{% capture year %}{{ post.date | date: '%Y' }}{% endcapture %}
{% capture nyear %}{{ post.next.date | date: '%Y' }}{% endcapture %}
{% if year != nyear %}
<h2 id="{{ post.date | date: '%Y年'}}">{{ post.date | date: '%Y年' }}</h2>
{% endif %}
{% endunless %}
<li>{{ post.date | date:"%Y-%m-%d:" }} <a href="{{ post.url }}" target="_blank">{{ post.title }}</a> <font color="#0085a1">☖</font> {% for tag in post.tags %}<a href="{{ site.baseurl }}/tags/#{{ tag }}" title="{{ tag }}" target="_blank"> <font color="#0085a1">{{ tag }}</font></a>{% endfor %}</li>
{% endfor %}
</ul>