-
Notifications
You must be signed in to change notification settings - Fork 0
/
tag.html
60 lines (50 loc) · 1.24 KB
/
tag.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
55
56
57
58
59
60
---
layout: page
title: Tags
---
{% comment%}
Here we generate all the tags.
{% endcomment%}
{% 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="posts">
<p>
{% for tag in tags %}
<a href="#{{ tag | slugify }}" class="codinfox-tag-mark"> {{ tag }} </a>
{% endfor %}
{% for tag in tags %}
<h2 id="{{ tag | slugify }}">{{ tag }}</h2>
<ul class="codinfox-category-list">
{% for post in site.posts %}
{% if post.tags contains tag %}
<li>
<h3>
<a href="{{ post.url }}">
{{ post.title }}
<small>{{ post.date | date_to_string }}</small>
</a>
{% for tag in post.tags %}
<a class="codinfox-tag-mark" href="/posts/tag/#{{ tag | slugify }}">{{ tag }}</a>
{% endfor %}
</h3>
</li>
{% endif %}
{% endfor %}
</ul>
{% endfor %}
</div>