From d64ffb77a1c5587f08fd57e0e46e0563e79bb3a5 Mon Sep 17 00:00:00 2001 From: TheThomaas Date: Fri, 25 Apr 2025 16:39:32 +0200 Subject: [PATCH] Create template for the cooklang recipes --- src/_includes/layouts/recipe-cook.njk | 111 ++++++++++++++++++++++++++ src/recipes-cook/recipes-cook.json | 3 + 2 files changed, 114 insertions(+) create mode 100644 src/_includes/layouts/recipe-cook.njk create mode 100644 src/recipes-cook/recipes-cook.json diff --git a/src/_includes/layouts/recipe-cook.njk b/src/_includes/layouts/recipe-cook.njk new file mode 100644 index 0000000..c6f3844 --- /dev/null +++ b/src/_includes/layouts/recipe-cook.njk @@ -0,0 +1,111 @@ +{% extends 'layouts/base.njk' %} + +{% block content %} + {% recipeimage image, "c-recipe__header-image", title, "100vw" %} +

{{ title }}

+
+
+
+
+ {% for tag in tags %} + {{ tag }} + {% endfor %} +
+ {% set ingredientsArray = [] %} + {% for ingredient in ingredients %} + {% set value = [ingredient.quantity, ingredient.units, " ", ingredient.name] | join %} + {% set ingredientsArray = (ingredientsArray.push(value), ingredientsArray) %} + {% endfor %} +
+ + {% if time or not servings == "" %} +
+ {% if time %} +

{% include "icons/time.svg" %}{{ time }}

+ {% endif %} + {% if not servings == "" %} +

+ + + + {{ site.servingsLabel }} +

+ {% endif %} +
+ {% endif %} + +

{{ site.ingredientsLabel }}

+ + + + +

Cookware

+
    + {% for ingredient in cookware %} +
  • + {% endfor %} +
+
+ +
+ {% set notesArr = notes.split('|') %} + {% if notesArr.length > 1 %} + + {% endif %} + + + {% for step in steps %} +

+ {% for stepDetail in step %}{{ stepDetail | safe }}{% endfor %} +

+ {% endfor %} + + {% if source %} +

Source

+ {% endif %} +
+
+
+
+ + + +{% endblock %} \ No newline at end of file diff --git a/src/recipes-cook/recipes-cook.json b/src/recipes-cook/recipes-cook.json new file mode 100644 index 0000000..956e0b2 --- /dev/null +++ b/src/recipes-cook/recipes-cook.json @@ -0,0 +1,3 @@ +{ + "layout": "layouts/recipe-cook" +} \ No newline at end of file