recipe-site/_includes/ingredients.html

25 lines
735 B
HTML
Raw Normal View History

{%- assign tag = "h2" -%}
{%- if page.collection == "subrecipes" -%}
{%- assign tag = "h4" -%}
{%- endif -%}
<{{tag}}>Ingredients</{{tag}}>
2020-03-01 08:38:27 +00:00
<ul class='ingredients'>
{% for item in page.ingredients -%}
{%- assign tag = "li" -%}
{%- if item[3] -%}
{%- assign tag = tag | append: " class='optional'" -%}
{%- endif -%}
{%- assign amount = item[0] | append: " " -%}
{%- assign end = "" -%}
{%- if item[0][0] -%}
{%- assign amount = item[0][0] | append: " to " | append: item[0][1] | append: " " -%}
{%- elsif item[0] == 0 -%}
{%- assign amount = "" -%}
{%- assign end = " to taste" -%}
{%- endif -%}
<{{ tag }}>{{ amount }} {%- if item[2] %}{{ item[2] }} of {% endif -%} {{ item[1] }}{{ end }}</li>
{% endfor %}
</ul>