-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcategories.html
executable file
·36 lines (32 loc) · 1.11 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
---
layout: page
title: Category Index
permalink: /categories/index.html
title: Category Index
tags: [Categories]
description: "An archive of posts sorted by categories."
---
{% capture site_categories %}{% for category in site.categories %}{{ category | first }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %}
{% assign category_words = site_categories | split:',' | sort %}
<ul class="tag-box inline">
{% assign category_list = category_words %}
{% for category in category_list %}
<li><a href="#{{ category }}">{{ category }} <span>{{ site.categories[category].size }}</span></a></li>
{% endfor %}
{% assign category_list = nil %}
</ul>
{% for category in category_words %}
<h2 id="{{ category }}">{{ category }}</h2>
<ul class="post-list">
{% assign pages_list = site.categories[category] %}
{% for post in pages_list %}
{% if post.title != null %}
{% if group == null or group == post.group %}
{% include post-listing.html %}
{% endif %}
{% endif %}
{% endfor %}
{% assign pages_list = nil %}
{% assign group = nil %}
</ul>
{% endfor %}