add support for 'x to y z of ingredient' format
This commit is contained in:
parent
08c6a2c18c
commit
f55dcebdb8
2 changed files with 2 additions and 2 deletions
|
@ -48,7 +48,7 @@ time: 240
|
|||
- `name` (string) - The displayed name of the recipe. Does not appear in the URL.
|
||||
- `author` (string, optional) - The author of the recipe.
|
||||
- `ingredients` (list) - Each entry in `ingredients` is an array consisting of up to four items:
|
||||
- amount (number) - The amount of this item to add, e.g. `2` for 2 cups of flour.
|
||||
- amount (number or array) - The amount of this item to add, e.g. `2` for 2 cups of flour. If this in an array, it will be printed as `amount[0] to amount[1]`. For example, if you wanted to say "2 to 3 cups of peas", you would write `[[2, 3], peas, cups]`.
|
||||
- ingredient name (string) - The name of the ingredient, e.g. `flour` for 2 cups of flour.
|
||||
- unit terminology (string, optional) - The unit that amount refers to, e.g. `cups` for 2 cups of flour. If left blank or null, as in `[1, egg]`, the output will simply be "1 egg".
|
||||
- optional (boolean, optional) - Whether or not this ingredient is optional. The ingredient `[1, chocolate egg, null, true]` produces "1 chocolate egg" and marks is as optional. Defaults to `false`.
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
<{{tag}}>Ingredients</{{tag}}>
|
||||
<ul class='ingredients'>
|
||||
{% for item in page.ingredients -%}
|
||||
<li class='{% if item[3] %}optional{% endif %}'>{{ item[0] }} {%- if item[2] %} {{ item[2] }} of {%- endif %} {{ item[1] }}</li>
|
||||
<li class='{% if item[3] %}optional{% endif %}'>{% if item[0][0] %}{{ item[0][0] }} to {{ item[0][1] }}{% else %}{{ item[0] }}{% endif %} {%- if item[2] %} {{ item[2] }} of {%- endif %} {{ item[1] }}</li>
|
||||
{% endfor -%}
|
||||
</ul>
|
||||
|
|
Loading…
Reference in a new issue