-
Notifications
You must be signed in to change notification settings - Fork 1
/
tagged.html
46 lines (41 loc) · 1.2 KB
/
tagged.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
---
layout: default
title: Tagged
---
{% assign rawtags = "" %}
{% for post in site.posts %}
{% assign ttags = post.tags | join:'|' | append:'|' %}
{% assign rawtags = rawtags | append:ttags %}
{% endfor %}
{% assign rawtags = rawtags | split:'|' | sort %}
{% assign tags = "" %}
{% for tag in rawtags %}
{% if tag != "" %}
{% if tags == "" %}
{% assign tags = tag | split:'|' %}
{% endif %}
{% unless tags contains tag %}
{% assign tags = tags | join:'|' | append:'|' | append:tag | split:'|' %}
{% endunless %}
{% endif %}
{% endfor %}
<div class="home">
<section class="site-header">
<h1 class="smallcap"><a class="site-title" href="{{ site.baseurl }}/">{{ site.title }}</a></h1>
<p>All tagged posts will be sorted here.</p>
</section>
<section>
{% for tag in tags %}
<h3 class="tag-title" id="{{ tag | slugify }}"># {{ tag }}</h3>
<ul class="post-list">
{% for post in site.posts %}
{% if post.tags contains tag %}
<li>
<a href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a> <time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%b %d, %Y" }}</time>
</li>
{% endif %}
{% endfor %}
</ul>
{% endfor %}
</section>
</div>