forked from h7aha7i86ana8aja8ai8y72084b/html
-
Notifications
You must be signed in to change notification settings - Fork 0
/
categories.html
29 lines (26 loc) · 1.23 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
---
layout: home
title: Blog Categories
description: "An archive of posts sorted by category."
comments: false
---
{% capture site_cats %}{% for cat in site.categories %}{{ cat | first }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %}
{% assign cats_list = site_cats | split:',' | sort %}
<ul class="entry-meta inline-list">
{% for item in (0..site.categories.size) %}{% unless forloop.last %}
{% capture this_word %}{{ cats_list[item] | strip_newlines }}{% endcapture %}
<li><a href="#{{ this_word }}" class="tag"><span class="term">{{ this_word }}</span> <span class="count">{{ site.categories[this_word].size }}</span></a></li>
{% endunless %}{% endfor %}
</ul>
{% for item in (0..site.categories.size) %}{% unless forloop.last %}
{% capture this_word %}{{ cats_list[item] | strip_newlines }}{% endcapture %}
<span class="anchor-bookmark" id="{{ this_word }}"></span>
<article>
<h2 class="tag-heading">{{ this_word }}</h2>
<ul>
{% for post in site.categories[this_word] %}{% if post.title != null %}
<li class="entry-title"><a href="{{ site.url }}{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a></li>
{% endif %}{% endfor %}
</ul>
</article><!-- /.hentry -->
{% endunless %}{% endfor %}