forked from barryclark/jekyll-now
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathyear.html
More file actions
87 lines (78 loc) · 2.8 KB
/
year.html
File metadata and controls
87 lines (78 loc) · 2.8 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
layout: default
title: 'Year'
---
<!--
Credits: this page shamelessly borrowed a lot from:
https://github.com/kitian616/jekyll-TeXt-theme
-->
{% include intro-header.html type='page' short=true %}
<!-- Main Content -->
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<!-- Tags (as filter) -->
<div id='tag_cloud' class="tags tags-sup js-tags">
<a class="tag-button--all" data-encode="">
Show All
<sup>{{site.posts.size}}</sup>
</a>
{%- capture site_years -%}
{% for post in site.posts %}
{{- post.date | date: "%Y" -}}{%- unless forloop.last -%},{%- endunless -%}
{% endfor %}
{%- endcapture -%}
{%- assign year_list = site_years | split:',' | sort | reverse -%}
{% capture years %}
{%- for _currentyear in year_list -%}
{% if _currentyear != year %}
<a data-sort="{{ site.posts.size | minus: _currentyear | prepend: '0000' | slice: -4, 4 }}"
data-encode="{{ _currentyear }}"
class="tag-button"
style="background-color: rgb(158, 179, 226);"
title="{{ _currentyear }}">
{{ _currentyear }}
</a>__SEPERATOR__
{% assign year = _currentyear %}
{% endif %}
{%- endfor -%}
{% endcapture %}
{{ years | split:'__SEPERATOR__' | sort }}
</div>
<!-- Article List -->
<div class="mini-post-list js-result d-none">
{%- assign _sorted_list = site.posts -%}
{%- assign _sorted_list = _sorted_list | sort: 'date' -%}
{%- assign _sorted_list = _sorted_list | reverse -%}
{%- for _article in _sorted_list -%}
{% comment %} group by year {% endcomment %}
{%- assign _currentyear = _article.date | date: '%Y' -%}
{%- if _currentyear != _year -%}
{%- unless forloop.first -%}</section>{%- endunless -%}
<section>
<span class="fa listing-seperator">
<span class="tag-text">{{ _currentyear }}</span>
</span>
{%- assign _year = _currentyear -%}
{%- endif -%}
{%- assign _year = '' -%}
{%- assign _year = _year | append: _currentyear -%}
<div class="post-preview item" data-tags="{{ _year }}">
<a href="{{ _article.url | prepend: site.baseurl }}">
<h2 class="post-title">
{{ _article.title }}
</h2>
{% if _article.subtitle %}
<h3 class="post-subtitle">
{{ _article.subtitle }}
</h3>
{% endif %}
</a>
<hr>
</div>
{%- if forloop.last -%}</section>{%- endif -%}
{% endfor %}
</div>
</div>
</div>
</div>