-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathyear.html
More file actions
67 lines (63 loc) · 2.1 KB
/
year.html
File metadata and controls
67 lines (63 loc) · 2.1 KB
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
---
layout: base
title: Year
permalink: /year/
---
{% assign strYearList = '' %}
{% for post in site.posts %}
{% if post.year %}
{% if strYearList contains post.year %}
{% assign strYearList = strYearList %}
{% else %}
{% assign strYearList = strYearList | append: ',' | append: post.year %}
{% endif %}
{% endif %}
{% endfor%}
{% assign yearList = strYearList | remove_first: ',' | split: ',' | sort | reverse %}
<style>
h3{
padding: 1em 0 0 0;
margin: 0px;
}
</style>
<div class="home">
{%- if page.title -%}
<h1 class="page-heading">{{ page.title }}</h1>
{%- endif -%}
<div>
{% for year in yearList %}
<a href="#{{ year | slugify }}" class="post-tag">{{ year }}</a>
   
{% endfor %}
</div>
<hr class="brand"/>
<div>
{% for year in yearList %}
<h3 id="{{ year | slugify }}">{{ year }}</h3>
<ul style="list-style-type: none;">
{% for post in site.posts %}
{% if post.year %}
{% assign strYear = post.year | append: "" %}
{% if strYear == year %}
<li>
<a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a>
<small>
<!-- {{ post.date | date_to_string }} -->
{%- if post.author -%}
•
{% assign authors = post.author | split: " and " %}
{%- for author in authors -%}
{% assign last_first = author | split: ", " %}
<span class="p-author h-card" itemprop="name">{{ last_first | slice: 1 }} {{ last_first | slice: 0}}</span>
{%- if forloop.last == false %}, {% endif -%}
{%- endfor -%}
{%- endif -%}
</small>
</li>
{% endif %}
{% endif %}
{% endfor %}
</ul>
{% endfor %}
</div>
</div>