Don't display empty sections on the homepage

This commit is contained in:
Bat 2018-09-05 18:28:23 +01:00
parent 13a04198f0
commit 9b119691d3

View file

@ -77,10 +77,12 @@
</svg>
{% endmacro %}
{% macro home_feed(title, link, articles) %}
<h2>{{ title | _ }} &mdash; <a href="{{ link }}">{{ "View all" | _ }}</a></h2>
<div class="cards spaced">
{% for article in articles %}
{{ macros::post_card(article=article) }}
{% endfor %}
</div>
{% if articles | length > 0 %}
<h2>{{ title | _ }} &mdash; <a href="{{ link }}">{{ "View all" | _ }}</a></h2>
<div class="cards spaced">
{% for article in articles %}
{{ macros::post_card(article=article) }}
{% endfor %}
</div>
{% endif %}
{% endmacro %}