From 0a2fc2094834c64f803828b5fcafe7533c886b16 Mon Sep 17 00:00:00 2001 From: L3D Date: Wed, 17 Nov 2021 00:39:45 +0100 Subject: [PATCH] update submodules --- templates/layout.html | 89 +++++++++-------- templates/rezept-post.html | 14 +++ templates/zutaten/rezept_ld.json.j2 | 96 +++++++++++++++++++ templates/zutaten/zutat_einzeln.html | 2 +- .../zutaten/zutat_einzeln_ohne_menge.html | 2 +- 5 files changed, 156 insertions(+), 47 deletions(-) create mode 100644 templates/zutaten/rezept_ld.json.j2 diff --git a/templates/layout.html b/templates/layout.html index 8eb5e27..0f27a0c 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -4,10 +4,11 @@ {%- endif %}> - - - - +{%- if this.path == '/' -%} + {{- '\n ' -}} + {{- '\n ' -}} +{%- endif -%} +{{- '\n' -}} -{# remove next line and robots.txt if LIVE not preview #} - {#- Namensschema der CSS-Klassen nach BEM (Block Element Modifier, @@ -55,7 +54,7 @@ {% block title %}C3 Waffel Operation Center{% endblock %} | C3WOC - + {#- OG Values https://ogp.me/ #} @@ -63,8 +62,8 @@ {% if '/images/waffel.jpg'|asseturl is defined -%} - {%- endif %} - {# JSON-LD SEO Optimisation Stuff... -#} + {%- endif -%} + {#- JSON-LD SEO Optimisation Stuff... -#} {%- block json_ld %} - {% endblock %} + {%- endblock %} - {% if '/css/reset.css'|asseturl is defined -%} - - {%- endif %} - {% if '/css/fonts.css'|asseturl is defined -%} - - {%- endif %} - {% if '/css/main.min.css'|asseturl is defined -%} - - {% endif %} - {% if '/images/icons/manifest.json'|asseturl is defined -%} - - {%- endif %} - {% if '/images/icons/apple-touch-icon.png'|asseturl is defined -%} - - {%- endif %} - {% if '/images/icons/favicon-32x32.png'|asseturl is defined -%} - - {%- endif %} - {% if '/images/icons/favicon-16x16.png'|asseturl is defined -%} - - {%- endif %} - {% if '/images/icons/site.webmanifest'|asseturl is defined -%} - - {%- endif %} - {% if '/images/icons/safari-pinned-tab.svg'|asseturl is defined -%} - - {%- endif %} - {% if '/images/icons/favicon.ico'|asseturl is defined -%} - - {%- endif %} - + {%- if '/css/reset.css'|asseturl is defined -%} + {{- '\n ' -}} + {%- endif -%} + {%- if '/css/fonts.css'|asseturl is defined -%} + {{- '\n ' -}} + {%- endif -%} + {%- if '/css/main.min.css'|asseturl is defined -%} + {{- '\n ' -}} + {%- endif -%} + {%- if '/images/icons/manifest.json'|asseturl is defined -%} + {{- '\n ' -}} + {%- endif -%} + {%- if '/images/icons/apple-touch-icon.png'|asseturl is defined -%} + {{- '\n ' -}} + {%- endif -%} + {%- if '/images/icons/favicon-32x32.png'|asseturl is defined -%} + {{- '\n ' -}} + {%- endif -%} + {%- if '/images/icons/favicon-16x16.png'|asseturl is defined -%} + {{- '\n ' -}} + {%- endif -%} + {%- if '/images/icons/site.webmanifest'|asseturl is defined -%} + {{- '\n ' -}} + {%- endif -%} + {%- if '/images/icons/safari-pinned-tab.svg'|asseturl is defined -%} + {{- '\n ' -}} + {%- endif -%} + {%- if '/images/icons/favicon.ico'|asseturl is defined -%} + {{- '\n ' -}} + {%- endif -%} {% if '/images/icons/browserconfig.xml'|asseturl is defined -%} - - {%- endif %} - + {{- '\n ' -}} + {%- endif -%} + {{- '\n ' -}} + {{- '\n ' -}} diff --git a/templates/rezept-post.html b/templates/rezept-post.html index 30592c7..8ba4aa0 100644 --- a/templates/rezept-post.html +++ b/templates/rezept-post.html @@ -8,6 +8,20 @@ C3WOC {%- endif -%} {%- endblock -%} +{# https://schema.org/Recipe #} +{%- block json_ld -%} + +{%- endblock -%} {%- block body -%} {{- render_rezept_post(this) -}} {%- endblock -%} diff --git a/templates/zutaten/rezept_ld.json.j2 b/templates/zutaten/rezept_ld.json.j2 new file mode 100644 index 0000000..7aea3f6 --- /dev/null +++ b/templates/zutaten/rezept_ld.json.j2 @@ -0,0 +1,96 @@ +{#- + 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 ' -}}
+ {{- '\n ' -}}
+ {{- '\n ' -}} +

+ {%- if child.recipe_name and child.recipe_name != "" -%} + {{ child.recipe_name }}

+ {%- else -%} + {{ child.title }} + {%- endif -%} + {%- if child.servings is defined and child.servings != "" -%} + {%- if child.servings.blocks != [] -%} + + {%- include "zutaten/zutaten.html" -%} + + {%- else -%} +

ungültige Rezeptangaben

+ {%- endif -%} + {%- endif -%} + {{- '\n ' -}}
+ {{- '\n ' -}}
+ { #- + + 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 -#} diff --git a/templates/zutaten/zutat_einzeln.html b/templates/zutaten/zutat_einzeln.html index f715834..8cc45f5 100644 --- a/templates/zutaten/zutat_einzeln.html +++ b/templates/zutaten/zutat_einzeln.html @@ -31,7 +31,7 @@ ({{ prc.process }}) {%- else -%} {{- ' ' -}} - (Angaben zur Verarbeitung von {{ ing.ingredient }} beachten) + (Angaben zur Verarbeitung von {{ ing.ingredient }} beachten) {%- endif -%} {%- endif -%} {%- endfor -%} diff --git a/templates/zutaten/zutat_einzeln_ohne_menge.html b/templates/zutaten/zutat_einzeln_ohne_menge.html index 23af638..9f46289 100644 --- a/templates/zutaten/zutat_einzeln_ohne_menge.html +++ b/templates/zutaten/zutat_einzeln_ohne_menge.html @@ -23,7 +23,7 @@ ({{ prc.process }}) {%- else -%} {{- ' ' -}} - (Angaben zur Verarbeitung von {{ ing.ingredient }} beachten) + (Angaben zur Verarbeitung von {{ ing.ingredient }} beachten) {%- endif -%} {%- endif -%} {%- endfor -%}