-
Notifications
You must be signed in to change notification settings - Fork 3
/
posts_cat.html
35 lines (26 loc) · 1.09 KB
/
posts_cat.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
---
layout: default
title: Posts
permalink: /posts/categories/
---
<div class="container">
<div class="inner-container posts">
<div class="switch">
<h3><a href="{{ site.baseurl }}/posts/chronological/">Chronological</a></h3>
<h2>|</h2>
<h3 id="active"><a href="{{ site.baseurl }}//posts/categories/" id="categories">Categories</a></h3>
</div>
<!-- Get the tag name for every tag on the site and set them to the `site_tags` variable. -->
{% capture site_tags %}{% for tag in site.tags %}{{ tag | first }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %}
<!-- `tag_words` is a sorted array of the tag names. -->
{% assign tag_words = site_tags | split:',' | sort %}
{% for item in (0..site.tags.size) %}{% unless forloop.last %}
{% capture this_word %}{{ tag_words[item] }}{% endcapture %}
<h4 id="posts-broad-headings">{{ this_word }}</h4>
{% for post in site.tags[this_word] %}{% if post.title != null %}
{% include post.html%}
{% endif %}{% endfor %}
{% endunless %}{% endfor %}
</div>
</div>
<br>