-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcategories.html
More file actions
23 lines (22 loc) · 1.06 KB
/
categories.html
File metadata and controls
23 lines (22 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
---
title: Categories
description: "An archive of posts sorted by categories"
layout: default
---
{% capture site_tags %}{% for tag in site.categories %}{{ tag | first }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %}
{% assign tag_words = site_tags | split:',' | sort %}
<p>
{% for tag in tag_words) %}
<a href="#{{ tag | slugify }}" class="btn btn-default btn-xs">{{ tag }} <span>({{ site.categories[tag] | size }})</span></a>
{% endfor %}
</p>
<hr>
{% for item in (0..site.categories.size) %}{% unless forloop.last %}
{% capture this_word %}{{ tag_words[item] | strip_newlines }}{% endcapture %}
<h2 id="{{ this_word | slugify }}">{{ this_word }}</h2>
<ul class="list-unstyled">
{% for post in site.categories[this_word] %}{% if post.title != null %}
<li itemscope><span class="entry-date"><time datetime="{{ post.date | date_to_xmlschema }}" itemprop="datePublished">{{ post.date | date: "%B %d, %Y" }}</time></span> — <a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a></li>
{% endif %}{% endfor %}
</ul>
{% endunless %}{% endfor %}