forked from tgist/tgist.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
categories.html
24 lines (21 loc) · 1.13 KB
/
categories.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
---
title: Categories
layout: page
---
{% capture site_categories %}{% for category in site.categories %}{{ category | first }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %}
<!-- site_categories: {{ site_categories }} -->
{% assign category_words = site_categories | split:',' | sort %}
<!-- category_words: {{ category_words }} -->
<ul class="tag-box">
{% for item in (0..site.categories.size) %}{% unless forloop.last %}
{% capture this_word %}{{ category_words[item] | strip_newlines }}{% endcapture %}
<li><a href="#{{ this_word | cgi_escape }}" rel="nofollow">{{ this_word }} <sup>{{ site.categories[this_word].size }}</sup></a></li>
{% endunless %}{% endfor %}
</ul>
{% for item in (0..site.categories.size) %}{% unless forloop.last %}
{% capture this_word %}{{ category_words[item] | strip_newlines }}{% endcapture %}
<h4 id="{{ this_word | cgi_escape }}">{{ this_word }}</h4>
{% for post in site.categories[this_word] %}{% if post.title != null %}
<ul><li>{{ post.date | date: "%Y-%m-%d" }} » <a href="{{ post.url }}">{{ post.title }}</a></li></ul>
{% endif %}{% endfor %}
{% endunless %}{% endfor %}