forked from rohanchandra/type-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tags.html
42 lines (40 loc) · 1.52 KB
/
tags.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
---
layout: page
title: Tags
hide: true
---
{% capture site_tags %}{% for tag in site.tags %}{{ tag | first }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %}
{% assign tag_words = site_tags | split:',' | sort %}
<div class="home">
<!-- cycles through tag list and creates header row of all tags used in site with accompanying per-tag counts -->
{% for item in (0..site.tags.size) %}
{% unless forloop.last %}
{% capture this_word %}{{ tag_words[item] | strip_newlines }}{% endcapture %}
<a class="button" href="#{{ this_word | cgi_escape }}">
<i class="fa fa-tag fa-fw"></i> {{ this_word }} ({{ site.tags[this_word].size }})
</a>
{% endunless %}
{% endfor %}
<!-- cycles through tag list and creates subheader for each tag name -->
{% for item in (0..site.tags.size) %}
{% unless forloop.last %}
{% capture this_word %}{{ tag_words[item] | strip_newlines }}{% endcapture %}
<h1 id="{{ this_word | cgi_escape }}">{{ this_word }}</h1>
<!-- lists all posts corresponding to specific tag -->
{% for post in site.tags[this_word] %}
{% if post.title != null %}
<div class="tagged-post">
<h2 class="title">
<a href="{{ post.url | prepend: site.baseurl }}">
{{ post.title }}
</a>
</h2>
<div class="meta">
{{ post.date | date: "%B %-d, %Y" }}
</div>
</div>
{% endif %}
{% endfor %}
{% endunless %}
{% endfor %}
</div>