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 }}
|
{{ content }}
|
||||||
|
|
||||||
<ul class="taxonomy__index">
|
{% assign categories_max = 0 %}
|
||||||
{% assign categories_max = 0 %}
|
{% for category in site.categories %}
|
||||||
{% for category in site.categories %}
|
|
||||||
{% if category[1].size > categories_max %}
|
{% if category[1].size > categories_max %}
|
||||||
{% assign categories_max = category[1].size %}
|
{% assign categories_max = category[1].size %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
<ul class="taxonomy__index">
|
||||||
{% for i in (1..categories_max) reversed %}
|
{% for i in (1..categories_max) reversed %}
|
||||||
{% for category in site.categories %}
|
{% for category in site.categories %}
|
||||||
{% if category[1].size == i %}
|
{% if category[1].size == i %}
|
||||||
|
@ -24,13 +25,6 @@ layout: archive
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</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 i in (1..categories_max) reversed %}
|
||||||
{% for category in site.categories %}
|
{% for category in site.categories %}
|
||||||
{% if category[1].size == i %}
|
{% if category[1].size == i %}
|
||||||
|
|
Loading…
Reference in a new issue