-
Notifications
You must be signed in to change notification settings - Fork 0
/
categories.html
39 lines (34 loc) · 1.1 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---
layout: default
title: Categories
permalink: categories/
---
<h2>{{page.title}}</h2>
{% capture categories %}
{% for category in site.categories %}
{{ category[0] }}
{% endfor %}
{% endcapture %}
{% assign sortedcategories = categories | split:' ' | sort_natural %}
<ul class='toc'>
{% for category in sortedcategories %}
<li><a href="#{{ category }}">{{ category }} [{{ site.categories[category].size }}]</a></li>
{% endfor %}
<li><a href="#others">Others [-]</a></li>
</ul>
{% for category in sortedcategories %}
<h3 id="{{ category | escape }}">{{ category }}</h3>
<ul>
{% for post in site.categories[category] %}
<li style='padding-bottom: 5px;'><a href="{{site.baseurl}}{{ post.url }}">{{ post.title }}</a>(<small style='color:gray;'>{{ post.date | date: "%Y-%m-%d" }}</small>)</li>
{% endfor %}
</ul>
{% endfor %}
<h3 id="others">Others</h3>
<ul>
{% for post in site.posts %}
{% if post.categories.size == 0 %}
<li><a href="{{site.baseurl}}{{ post.url }}">{{ post.title }}</a>(<small style='color:gray;'>{{ post.date | date: "%Y-%m-%d" }}</small>)</li>
{% endif %}
{% endfor %}
</ul>