DRY tags_max calculation in _layouts/tags.html (#1696)

It was being done twice, and it doesn't seem to need to be.
This commit is contained in:
Dan Jackson 2018-06-04 08:54:29 -07:00 committed by Michael Rose
parent 2bf2c83fea
commit e366a9a72b

View file

@ -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 %}
<ul class="taxonomy__index">
{% 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 %}
@ -24,13 +25,6 @@ layout: archive
{% endfor %}
</ul>
{% 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 %}