sort tags, don't print with only 1 tag

This commit is contained in:
⧉ infominer 2020-12-04 20:22:46 -05:00
parent ea011e2093
commit b8b0b5137b

View File

@ -5,7 +5,8 @@ layout: archive
{{ content }}
{% assign tags_max = 0 %}
{% for tag in site.tags %}
{% assign sortedtags = site.tags | sort %}
{% for tag in sortedtags %}
{% if tag[1].size > tags_max %}
{% assign tags_max = tag[1].size %}
{% endif %}
@ -13,20 +14,22 @@ layout: archive
<ul class="taxonomy__index">
{% for i in (1..tags_max) reversed %}
{% for tag in site.tags %}
{% for tag in sortedtags %}
{% if tag[1].size == i %}
<li>
<a href="#{{ tag[0] | slugify }}">
<strong>{{ tag[0] }}</strong> <span class="taxonomy__count">{{ i }}</span>
</a>
</li>
{% unless tag[1].size == 1 %}
<li>
<a href="#{{ tag[0] | slugify }}">
<strong>{{ tag[0] }}</strong> <span class="taxonomy__count">{{ i }}</span>
</a>
</li>
{% endunless %}
{% endif %}
{% endfor %}
{% endfor %}
</ul>
{% for i in (1..tags_max) reversed %}
{% for tag in site.tags %}
{% for tag in sortedtags %}
{% if tag[1].size == i %}
{% unless tag[1].size == 1 %}
<section id="{{ tag[0] | slugify | downcase }}" class="taxonomy__section">