-
Notifications
You must be signed in to change notification settings - Fork 195
Expand file tree
/
Copy patharchive.html
More file actions
61 lines (57 loc) · 2.4 KB
/
archive.html
File metadata and controls
61 lines (57 loc) · 2.4 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
---
title: Browse the Archive
permalink: "/archive/"
layout: default
image:
twitter: "/public/wtfjht-t.jpg"
facebook: "/public/wtfjht-f.jpg"
---
<div class="browse-archive">
<h1 class="browse-archive__heading">Browse the Archive</h1>
<p class="browse-archive__summary">{{ site.posts | size | number_with_commas }} posts since January 2017</p>
<p class="browse-archive__calendar">
<a href="/big-grid/">View as calendar heatmap →</a>
</p>
<section class="browse-archive__section">
<h2 class="browse-archive__section-title">By Date</h2>
{% assign years = site.archives | where:"type", "year" %}
{% for year in years reversed %}
<div class="browse-archive__year">
<a href="{{ year.url }}" class="browse-archive__year-link">{{ year.posts[0].date | date:"%Y" }}</a>
{% assign months = site.archives | where:"type", "month" %}
<span class="browse-archive__months">
{%- assign first_month = true -%}
{%- for month in months reversed -%}
{%- assign monthYear = month.posts[0].date | date:"%Y" -%}
{%- assign yearYear = year.posts[0].date | date:"%Y" -%}
{%- if monthYear == yearYear -%}
{%- unless first_month -%}<span class="browse-archive__sep"> · </span>{%- endunless -%}
<a href="{{ month.url }}" class="browse-archive__month">{{ month.posts[0].date | date:"%b" }}</a>
{%- assign first_month = false -%}
{%- endif -%}
{%- endfor -%}
</span>
</div>
{% endfor %}
</section>
<section class="browse-archive__section">
<h2 class="browse-archive__section-title">By Topic</h2>
{% assign sorted_tags = site.tags | sort %}
<ul class="browse-archive__tags">
{% for tag in sorted_tags %}
{% assign tag_name = tag[0] %}
{% assign tag_posts = tag[1] %}
{% assign tag_words = tag_name | split: '-' %}
{% assign capitalized_words = '' | split: '' %}
{% for word in tag_words %}
{% assign cap_word = word | capitalize %}
{% assign capitalized_words = capitalized_words | push: cap_word %}
{% endfor %}
{% assign tag_display = capitalized_words | join: ' ' %}
<li class="browse-archive__tag">
<a href="/tags/{{ tag_name }}/">{{ tag_display }} <span class="browse-archive__tag-count">{{ tag_posts | size }}</span></a>
</li>
{% endfor %}
</ul>
</section>
</div>