From 9a71545421ec98f3dacc09d9aa13985bd8b2f7a1 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sun, 7 Oct 2018 19:49:37 +0100 Subject: [PATCH] Sort tags by post count --- source/blog/tags.html | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source/blog/tags.html b/source/blog/tags.html index a170cb222..27ccb2d4b 100644 --- a/source/blog/tags.html +++ b/source/blog/tags.html @@ -5,7 +5,10 @@ title: Tags use: - posts_tags --- -

Blog Tags

+{% set rows = {} %} +{% for tag, posts in data.posts_tags %} + {% set rows = rows|merge({ (tag): posts|length }) %} +{% endfor %}
@@ -16,14 +19,12 @@ use: - {% for tag, posts in data.posts_tags %} + {% for tag, post_count in rows|sort|reverse %} - + {% endfor %}
- - {{ tag }} - + {{ tag }} {{ posts|length }}{{ post_count }}