DRY categories_max
calculation in categories.html layout
This commit is contained in:
parent
e366a9a72b
commit
2e1ff9eeb1
1 changed files with 7 additions and 13 deletions
|
@ -4,13 +4,14 @@ layout: archive
|
|||
|
||||
{{ content }}
|
||||
|
||||
{% assign categories_max = 0 %}
|
||||
{% for category in site.categories %}
|
||||
{% if category[1].size > categories_max %}
|
||||
{% assign categories_max = category[1].size %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
<ul class="taxonomy__index">
|
||||
{% assign categories_max = 0 %}
|
||||
{% for category in site.categories %}
|
||||
{% if category[1].size > categories_max %}
|
||||
{% assign categories_max = category[1].size %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% for i in (1..categories_max) reversed %}
|
||||
{% for category in site.categories %}
|
||||
{% if category[1].size == i %}
|
||||
|
@ -24,13 +25,6 @@ layout: archive
|
|||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
{% assign categories_max = 0 %}
|
||||
{% for category in site.categories %}
|
||||
{% if category[1].size > categories_max %}
|
||||
{% assign categories_max = category[1].size %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% for i in (1..categories_max) reversed %}
|
||||
{% for category in site.categories %}
|
||||
{% if category[1].size == i %}
|
||||
|
|
Loading…
Reference in a new issue