-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathall-posts.html
56 lines (50 loc) · 1.86 KB
/
all-posts.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: page
title: 'All Posts'
subtitle: The complete list
description: "All the blog posts written by Cesar Soto Valero"
---
{% assign date_format = site.date_format | default: "%B %-d, %Y" %}
{% assign years_list = "" | split: "" %}
{%- for post in site.posts -%}
{%- assign post_year = post.date | date: "%Y" -%}
{%- unless years_list contains post_year -%}
{%- assign years_list = years_list | push: post_year -%}
{%- endunless -%}
{%- endfor -%}
{%- assign years_list = years_list | sort -%}
<!-- Years cloud -->
<div class="tag-list">
{%- for year in years_list -%}
<a href="#{{- year -}}" class="btn btn-primary tag-btn"><i class="fas fa-calendar-alt" aria-hidden="true"></i> {{- year -}} </a>
{%- endfor -%}
</div>
{% assign reverse_years_list = years_list | reverse %}
<div id="full-tags-list">
{%- for year in reverse_years_list -%}
{%- assign posts_count = 0 -%}
{%- for post in site.posts -%}
{%- assign post_year = post.date | date: "%Y" -%}
{%- if post_year == year -%}
{%- assign posts_count = posts_count | plus: 1 -%}
{%- endif -%}
{%- endfor -%}
<h3 id="{{- year -}}" class="linked-section">
<i class="fas fa-calendar-alt" aria-hidden="true"></i>
{{- year -}} ({{ posts_count }})
</h3>
<div class="post-list">
{%- for post in site.posts -%}
{%- assign post_year = post.date | date: "%Y" -%}
{%- if post_year == year -%}
<div class="tag-entry">
<a href="{{ post.url | relative_url }}">{{- post.title -}}</a>
<div class="entry-date">
<time datetime="{{- post.date | date_to_xmlschema -}}">{{- post.date | date: date_format -}}</time>
</div>
</div>
{%- endif -%}
{%- endfor -%}
</div>
{%- endfor -%}
</div>