When one post have only one category will hit the bug.
This commit is contained in:
parent
08d4ce77e2
commit
532e7ad451
1 changed files with 5 additions and 3 deletions
|
@ -20,9 +20,11 @@ title: Categories
|
||||||
|
|
||||||
{% for post in posts_of_category %}
|
{% for post in posts_of_category %}
|
||||||
{% assign second_category = post.categories[1] %}
|
{% assign second_category = post.categories[1] %}
|
||||||
{% unless sub_categories contains second_category %}
|
{% if second_category %}
|
||||||
{% assign sub_categories = sub_categories | push: second_category %}
|
{% unless sub_categories contains second_category %}
|
||||||
{% endunless %}
|
{% assign sub_categories = sub_categories | push: second_category %}
|
||||||
|
{% endunless %}
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% assign sub_categories = sub_categories | sort %}
|
{% assign sub_categories = sub_categories | sort %}
|
||||||
|
|
Loading…
Reference in a new issue