From b8b0b5137b540dbc572014577d1e7256fc1f48b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=A7=89=20infominer?= Date: Fri, 4 Dec 2020 20:22:46 -0500 Subject: [PATCH] sort tags, don't print with only 1 tag --- _layouts/tags.html | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/_layouts/tags.html b/_layouts/tags.html index 054b2a94..e6c36306 100644 --- a/_layouts/tags.html +++ b/_layouts/tags.html @@ -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 {% 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 %}