Skip to content

Commit

Permalink
DRY tags_max calculation in _layouts/tags.html (mmistakes#1696)
Browse files Browse the repository at this point in the history
It was being done twice, and it doesn't seem to need to be.
  • Loading branch information
e28eta authored and mmistakes committed Jun 4, 2018
1 parent eba3771 commit 4cbfad8
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions _layouts/tags.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

<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 %}
Expand All @@ -24,13 +25,6 @@
{% 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 %}
Expand Down

0 comments on commit 4cbfad8

Please sign in to comment.