From b13b3ff21d5d047f65f7f0a9fa6536925efa7f57 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 1c0e70231..128e176e4 100644 --- a/_layouts/tags.html +++ b/_layouts/tags.html @@ -4,13 +4,14 @@ {{ 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 %}