From 44750d2781ec19409135375189c8179955d8cf6e Mon Sep 17 00:00:00 2001 From: Dan Jackson Date: Mon, 4 Jun 2018 08:54:29 -0700 Subject: [PATCH] DRY `tags_max` calculation in _layouts/tags.html (#1696) It was being done twice, and it doesn't seem to need to be. --- _layouts/tags.html | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/_layouts/tags.html b/_layouts/tags.html index 1c0e702..128e176 100644 --- a/_layouts/tags.html +++ b/_layouts/tags.html @@ -4,13 +4,14 @@ layout: archive {{ content }} +{% assign tags_max = 0 %} +{% for tag in site.tags %} + {% if tag[1].size > tags_max %} + {% assign tags_max = tag[1].size %} + {% endif %} +{% endfor %} + -{% assign tags_max = 0 %} -{% for tag in site.tags %} - {% if tag[1].size > tags_max %} - {% assign tags_max = tag[1].size %} - {% endif %} -{% endfor %} - {% for i in (1..tags_max) reversed %} {% for tag in site.tags %} {% if tag[1].size == i %} -- 2.45.2