Don't show Ingredients/Steps h3 when there are none

This commit is contained in:
Emi Vasilek 2023-11-06 23:32:24 +01:00
parent 347231f013
commit dcb566275c

View file

@ -17,14 +17,18 @@
{{getrecipe(subrecipe)}} {{getrecipe(subrecipe)}}
{% endfor %} {% endfor %}
<h1>{{rec.title}}</h1> <h1>{{rec.title}}</h1>
{% if rec.ingredients|length != 0 %}
<h3>Ingredients</h3> <h3>Ingredients</h3>
{% for ing in rec.ingredients %} {% for ing in rec.ingredients %}
<li>{{ingredient(ing)}}</li> <li>{{ingredient(ing)}}</li>
{% endfor %} {% endfor %}
{% endif %}
{% if rec.steps|length != 0 %}
<h3>Steps</h3> <h3>Steps</h3>
{% for step in rec.steps %} {% for step in rec.steps %}
<li>{{ step }}</li> <li>{{ step }}</li>
{% endfor %} {% endfor %}
{% endif %}
<hr> <hr>
{%- endmacro %} {%- endmacro %}