Skip to content

Commit

Permalink
DRY tags_max calculation in _layouts/tags.html (#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 2bf2c83 commit e366a9a
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 e366a9a

Please sign in to comment.