webseite/templates/zutaten.yaml
2021-07-29 00:30:14 +02:00

173 lines
7.2 KiB
YAML

---
{#
definition_ORF: "https://open-recipe-format.readthedocs.io/en/latest/topics/reference/orf.html"
json_schema: "https://raw.githubusercontent.com/techhat/openrecipeformat/master/schema.json"
validator: "https://json-schema.org/"
validator_steps:
- "pip3 install jsonschema"
- "install yq"
- "wget {{ json_schema }}"
- "curl rezep.yaml | yq -j > rezept.json"
- "jsonschema -i rezept.json schema.json"
usda_lookup: "https://fdc.nal.usda.gov/fdc-app.html" -#}
{%- if this.recipe_name and this.recipe_name != "" -%}
recipe_name: "{{ this.recipe_name | default(this.title) }}"
{%- else -%}
recipe_name: "{{ this.title }}"
{%- endif -%}
{%- if this.recipe_uuid is defined and this.recipe_uuid != "" -%}
{{ '\nrecipe_uuid:' }} "{{ this.recipe_uuid }}"
{%- endif -%}
{%- if this.servings is defined and this.servings != "" -%}
{%- for prt in this.servings.blocks -%}
{%- if loop.index == 1 -%}
{{ '\nyields:' }}
{%- endif -%}
{{ '\n - servings:' }} {{ prt.serving_number | default('1') }}
{%- endfor -%}
{%- endif -%}
{%- if this.ingredients is defined and this.ingredients != "" %}
{{ '\ningredients:' }}
{%- for ing in this.ingredients.blocks %}
{%- if ing.ingredient is defined and ing.ingredient != "" -%}
{{ '\n -' }} "{{ ing.ingredient | lower }}":
{%- if ing.amounts is defined and ing.amounts != "" and ing.amounts.blocks is defined and ing.amounts.blocks != "" -%}
{{ '\n amounts:' }}
{%- if ing.amounts.blocks == [] -%}
{{ ' []' }}
{%- else -%}
{%- for amt in ing.amounts.blocks -%}
{{ '\n - amount:' }} "{{ amt.amount }}"
{{- '\n unit:' }} "{{ amt.unit | default('each') }}"
{%- endfor -%}
{%- endif -%}
{%- endif -%}
{%- if ing.processing is defined and ing.processing != "" and ing.processing.blocks is defined and ing.processing.blocks != "" -%}
{%- for prc in ing.processing.blocks -%}
{%- if loop.index == 1 -%}
{{ '\n processing:' }}
{%- endif -%}
{{ '\n -' }} "{{ prc.process }}"
{%- endfor -%}
{%- endif -%}
{%- if ing.notes is defined and ing.notes != "" and ing.notes.blocks is defined and ing.notes.blocks != "" -%}
{%- for nde in ing.notes.blocks -%}
{%- if loop.index == 1 -%}
{{ '\n notes:' }}
{%- endif -%}
{{ '\n -' }} "{{ nde.note }}"
{%- endfor -%}
{%- endif -%}
{%- if ing.usda_num is defined and ing.usda_num != "" -%}
{{ '\n usda_num:' }} {{ ing.usda_num }}
{%- endif -%}
{%- if ing.substitutions is defined and ing.substitutions != "" -%}
{%- if ing.substitutions.blocks is defined and ing.substitutions.blocks != "" -%}
{%- if ing.substitutions.blocks != [] -%}
{%- for sst in ing.substitutions.blocks -%}
{%- if loop.index == 1 -%}
{{ '\n substitutions:' }}
{%- endif -%}
{{ '\n -' }} "{{ sst.ingredient | lower }}"
{%- if sst.amounts is defined and sst.amounts != "" and sst.amounts.blocks is defined and sst.amounts.blocks != "" -%}
{{ '\n amounts:' }}
{%- if sst.amounts.blocks == [] -%}
{{ ' []' }}
{%- else -%}
{%- for amt2 in sst.amounts.blocks -%}
{{ '\n - amount:' }} "{{ amt2.amount }}"
{{- '\n unit:' }} "{{ amt2.unit | default('each') }}"
{%- endfor -%}
{%- endif -%}
{%- endif -%}
{%- if sst.usda_num is defined and sst.usda_num != "" -%}
{{ '\n usda_num:' }} {{ sst.usda_num }}
{%- endif -%}
{%- if sst.processing is defined and sst.processing != "" and sst.processing.blocks is defined and sst.processing.blocks != "" -%}
{%- for prc2 in sst.processing.blocks -%}
{%- if loop.index == 1 -%}
{{ '\n processing:' }}
{%- endif -%}
{{ '\n -' }} "{{ prc2.process }}"
{%- endfor -%}
{%- endif -%}
{%- if sst.notes is defined and sst.notes != "" and sst.notes.blocks is defined and sst.notes.blocks != "" -%}
{%- for nde2 in sst.notes.blocks -%}
{%- if loop.index == 1 -%}
{{ '\n notes:' }}
{%- endif -%}
{{ '\n -' }} "{{ nde2.note }}"
{%- endfor -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- endif -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- else -%}
{{ '\ningredients: []' }}
{%- endif -%}
{%- if this.steps is defined and this.steps.blocks is defined and this.steps != "" -%}
{%- if this.steps.blocks is defined and this.steps.blocks != "" and this.steps.blocks != [] -%}
{{ '\n\nsteps:' }}
{%- for stp in this.steps.blocks -%}
{%- if stp.step is defined and stp.step != "" -%}
{{ '\n - step:' }} "{{ stp.step }}"
{%- if stp.haccp_type is defined and stp.haccp_type != "" and stp.haccp_string is defined and stp.haccp_string != "" -%}
{{ '\n haccp:' }}
{{- '\n '}}{{ stp.haccp_type|lower }}: "{{ stp.haccp_string }}"
{%- endif %}
{%- if stp.notes is defined and stp.notes != "" and stp.notes.blocks is defined %}
{%- for nde in stp.notes.blocks %}
{%- if loop.index == 1 -%}
{{ '\n notes:' }}
{%- endif -%}
{{ '\n -' }} "{{ nde.note }}"
{%- endfor %}
{%- endif %}
{%- endif %}
{%- endfor -%}
{{ '\n' }}
{%- else -%}
{{ '\nsteps: []' }}
{%- endif -%}
{%- else -%}
{{ '\n\nsteps: []' }}
{%- endif -%}
{%- if this.oven is defined and this.oven != "" and this.oven.blocks is defined and this.oven.blocks != "" -%}
{% if this.oven.blocks is defined and this.oven.blocks != [] -%}
{%- for ovn in this.oven.blocks -%}
{%- if ovn.amount is defined and ovn.amount != "" -%}
{%- if loop.index == 1 -%}
{{ '\noven_temp:' }}
{%- endif -%}
{{ '\n - amount:' }} {{ ovn.amount }}
{{- '\n unit:' }} {{ ovn.unit | default('C') }}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- endif -%}
{%- if this.oven_type is defined and this.oven_type != "" -%}
{{ '\nX-oven_type:' }} "{{ this.oven_type }}"
{%- endif -%}
{%- if this.oven_time is defined and this.oven_time != "" -%}
{{ '\noven_time:' }} "{{ this.oven_time }}"
{%- endif -%}
{%- if this.oven_fan is defined and this.oven_fan != "" -%}
{{ '\noven_fan:' }} "{{ this.oven_fan | default('Off') }}"
{%- endif -%}
{%- if this.source_authors is defined and this.source_authors != "" -%}
{{ '\n\nsource_authors:'}} "{{ this.source_authors }}"
{%- endif -%}
{%- if this.x_license is defined and this.x_license != "" -%}
{{ '\nX-License:' }} "{{ this.x_license }}"
{%- endif -%}
{{ '\nsource_url:' }} "{{ '../'|url(external=true) }}"
{#- source: "https://open-recipe-format.readthedocs.io/en/latest/topics/tutorials/walkthrough.html" -#}