~xdavidwu/xdavidwu.link

44750d2781ec19409135375189c8179955d8cf6e — Dan Jackson 6 years ago 5133067
DRY `tags_max` calculation in _layouts/tags.html (#1696)

It was being done twice, and it doesn't seem to need to be.
1 files changed, 7 insertions(+), 13 deletions(-)

M _layouts/tags.html
M _layouts/tags.html => _layouts/tags.html +7 -13
@@ 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 %}