96 lines
3 KiB
Django/Jinja
96 lines
3 KiB
Django/Jinja
{#-
|
|
LD+JSON Rendering des Rezept aus dem zutaten.yaml template für die Detailseite des Rezepts.
|
|
based on https://schema.org/Recipe
|
|
-#}
|
|
|
|
{#-
|
|
"@context": "https://schema.org",
|
|
"@type": "Recipe",
|
|
"author": "John Smith",
|
|
"cookTime": "PT1H",
|
|
"datePublished": "2009-05-08",
|
|
"description": "This classic banana bread recipe comes from my mom -- the walnuts add a nice texture and flavor to the banana bread.",
|
|
"image": "bananabread.jpg",
|
|
"recipeIngredient": [
|
|
"3 or 4 ripe bananas, smashed",
|
|
"1 egg",
|
|
"3/4 cup of sugar"
|
|
],
|
|
"interactionStatistic": {
|
|
"@type": "InteractionCounter",
|
|
"interactionType": "https://schema.org/Comment",
|
|
"userInteractionCount": "140"
|
|
},
|
|
"name": "Mom's World Famous Banana Bread",
|
|
"nutrition": {
|
|
"@type": "NutritionInformation",
|
|
"calories": "240 calories",
|
|
"fatContent": "9 grams fat"
|
|
},
|
|
"prepTime": "PT15M",
|
|
"recipeInstructions": "Preheat the oven to 350 degrees. Mix in the ingredients in a bowl. Add the flour last. Pour the mixture into a loaf pan and bake for one hour.",
|
|
"recipeYield": "1 loaf",
|
|
"suitableForDiet": "https://schema.org/LowFatDiet"
|
|
-#}
|
|
|
|
{{- '\n "@context": "https://schema.org",' -}}
|
|
{{- '\n "@type": "Recipe",' -}}
|
|
{{- '\n "author": ' -}}
|
|
{%- if this.author is defined -%}
|
|
"{{- this.author -}}"
|
|
{%- else -%}
|
|
"C3WOC"
|
|
{%- endif -%}
|
|
|
|
{#- for child in this.children -%}
|
|
{%- if child._template == 'zutaten.yaml' -%}
|
|
{ #-
|
|
|
|
Zunächst werden die Zutaten des Rezept definiert...
|
|
|
|
-# }
|
|
{{- '\n ' -}} <div class="content__box">
|
|
{{- '\n ' -}} <div class="content__inner_box">
|
|
{{- '\n ' -}}
|
|
<h1 id="{{- child.parent._gid[:8] -}}-{{- child.parent._gid[-6:-2] -}}-{{- child._gid[-8:-4] }}-{{- child._gid[-4:] -}}-{{- child._gid[:12] -}}">
|
|
{%- if child.recipe_name and child.recipe_name != "" -%}
|
|
{{ child.recipe_name }}</h1>
|
|
{%- else -%}
|
|
{{ child.title }}</h1>
|
|
{%- endif -%}
|
|
{%- if child.servings is defined and child.servings != "" -%}
|
|
{%- if child.servings.blocks != [] -%}
|
|
|
|
{%- include "zutaten/zutaten.html" -%}
|
|
|
|
{%- else -%}
|
|
<p>ungültige Rezeptangaben</p>
|
|
{%- endif -%}
|
|
{%- endif -%}
|
|
{{- '\n ' -}} </div>
|
|
{{- '\n ' -}} </div>
|
|
{ #-
|
|
|
|
Nachdem die Zutaten des Rezept nun angegeben sind,
|
|
folgt die Zubereitung der waffelfähigen Teigprodukte...
|
|
|
|
-# }
|
|
{%- if child.steps is defined and child.steps.blocks is defined and child.steps != "" -%}
|
|
{%- if child.steps.blocks is defined and child.steps.blocks != "" and child.steps.blocks != [] -%}
|
|
{%- include "zutaten/zubereitung.html" -%}
|
|
{%- endif -%}
|
|
{%- endif -%}
|
|
{%- include "zutaten/hinweise.html" -%}
|
|
{ #-
|
|
|
|
Render die Notizen und Angaben zur Verarbeitung der einzelnen Zutaten
|
|
|
|
-# }
|
|
{%- if child.ingredients is defined and child.ingredients != "" %}
|
|
{%- if child.ingredients.blocks != [] -%}
|
|
{%- include "zutaten/zutat_notes.html" -%}
|
|
{%- endif -%}
|
|
{%- endif -%}
|
|
|
|
{%- endif -%}
|
|
{%- endfor -#}
|