forked from vsoch/tw-jekyll
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtags.html
20 lines (18 loc) · 1.28 KB
/
tags.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
---
title: Tags Index
permalink: /tags/
---
{% capture site_tags %}{% for tag in site.tags %}{% if tag %}{{ tag | first }}{% unless forloop.last %},{% endunless %}{% endif %}{% endfor %}{% endcapture %}{% assign docs_tags = "" %}{% for doc in site.docs %}{% assign ttags = doc.tags | join:',' | append:',' %}{% assign docs_tags = docs_tags | append:ttags %}{% endfor %}
{% assign all_tags = site_tags | append:docs_tags %}{% assign tags_list = all_tags | split:',' | uniq | sort %}
{% for tag in tags_list %}{% if tag %}<h3 id="{{ tag | replace: '/', '-' }}" class="linked-section">{{ tag }}</h3>
<div class="post-list" style="margin-bottom:40px">
{% for post in site.tags[tag] %}<div class="tag-entry">
<a href="{{- site.url -}}{{- post.url -}}">{{- post.title -}}</a>
<time style="font-style:italic; float:right" datetime="{{- post.date | date_to_xmlschema -}}"> {{- post.date | date: "%B %d, %Y" -}}</time>
</div>{%- endfor -%}
{% for doc in site.docs %}{% if doc.tags contains tag %}
<div class="tag-entry">
<a href="{{- site.baseurl -}}{{- doc.url -}}">{{ doc.title }}</a>
<time style="font-style:italic; float:right" datetime="{{- doc.date | date_to_xmlschema -}}"> {{- doc.date | date: "%B %d, %Y" -}}</time>
</div>{% endif %}{% endfor %}
</div>{% endif %}{%- endfor -%}