Skip to content

Commit 237dd46

Browse files
Add Categories
1 parent 5bf8b24 commit 237dd46

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

category.html

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
layout: page
3+
title: Category Index
4+
permalink: /categories/
5+
title: Category Index
6+
tags: [Categories]
7+
description: "An archive of posts sorted by categories."
8+
---
9+
<ul class="tag-box inline">
10+
{% assign tags_list = site.categories %}
11+
{% if tags_list.first[0] == null %}
12+
{% for tag in tags_list %}
13+
<li><a href="#{{ tag }}">{{ tag | capitalize }} <span>{{ site.tags[tag].size }}</span></a></li>
14+
{% endfor %}
15+
{% else %}
16+
{% for tag in tags_list %}
17+
<li><a href="#{{ tag[0] }}">{{ tag[0] | capitalize }} <span>{{ tag[1].size }}</span></a></li>
18+
{% endfor %}
19+
{% endif %}
20+
{% assign tags_list = nil %}
21+
</ul>
22+
{% for tag in site.categories %}
23+
<h2 id="{{ tag[0] }}">{{ tag[0] | capitalize }}</h2>
24+
<ul class="post-list">
25+
{% assign pages_list = tag[1] %}
26+
{% for post in pages_list %}
27+
{% if post.title != null %}
28+
{% if group == null or group == post.group %}
29+
<li><a href="{{ site.url }}{{ post.url }}">{{ post.title }}<span class="entry-date"><time datetime="{{ post.date | date_to_xmlschema }}" itemprop="datePublished">{{ post.date | date: "%b %d, %Y" }}</time></a></li>
30+
{% endif %}
31+
{% endif %}
32+
{% endfor %}
33+
{% assign pages_list = nil %}
34+
{% assign group = nil %}
35+
</ul>
36+
{% endfor %}

0 commit comments

Comments
 (0)