commit 945e17cb7daa617369b0afd978b0f2a74cd81af5
parent 2bbde2ce4622c8974b16c33aad67488607ad54c7
Author: MTRNord <mtrnord1@gmail.com>
Date: Thu, 16 Nov 2023 20:56:45 +0100
Add first real recipes and further improve the template
Diffstat:
9 files changed, 43 insertions(+), 47 deletions(-)
diff --git a/astro.config.mjs b/astro.config.mjs
@@ -9,6 +9,12 @@ import tailwind from "@astrojs/tailwind";
export default defineConfig({
integrations: [starlightLinksValidator(), starlight({
title: 'Rezepte',
+ locales: {
+ root: {
+ label: 'Deutsch',
+ lang: 'de-DE'
+ }
+ },
customCss: [
'./src/tailwind.css',
],
diff --git a/markdoc.config.mjs b/markdoc.config.mjs
@@ -19,6 +19,6 @@ export default defineMarkdocConfig({
title: { type: String },
icon: { type: String },
},
- }
+ },
},
});
\ No newline at end of file
diff --git a/src/components/recipe.astro b/src/components/recipe.astro
@@ -3,13 +3,13 @@ import type { Props } from "@astrojs/starlight/props";
import { Recipe as CooklangRecipe } from "@cooklang/cooklang-ts";
import Default from "@astrojs/starlight/components/MarkdownContent.astro";
-const isRecipe = Astro.props.slug.includes("recipes");
+const isRecipe = Astro.props.slug.includes("recipes/");
const recipe = new CooklangRecipe(Astro.props.entry.body, {
defaultIngredientAmount: "etwas",
});
const meta_array = Array.from(Object.entries(recipe.metadata));
-const contains_source = meta_array.find(([key, _value]) => "source" == key);
-const source_url_raw = recipe.metadata.source ?? "";
+const contains_source = meta_array.find(([key, _value]) => "source" === key.toLowerCase() || "quelle" === key.toLowerCase());
+const source_url_raw = (contains_source ?? [])[1] ?? "";
const source_url = source_url_raw.replace("<", "").replace(">", "");
---
@@ -18,8 +18,8 @@ const source_url = source_url_raw.replace("<", "").replace(">", "");
<Default {...Astro.props}>
<article>
<p class="no-margin-children">
- {recipe.metadata.source ? (
- <a href={source_url}>{source_url}</a><br/>
+ {(contains_source?.length ?? 0) > 0 ? (
+ <><b>Quelle: </b>{source_url.includes("http") ? <a href={source_url}>{source_url}</a> : <span>{source_url}</span>}<br/></>
) : (
<><b>Quelle: </b>Keine Quelle angegeben</><br/>
)}
@@ -29,7 +29,7 @@ const source_url = source_url_raw.replace("<", "").replace(">", "");
(
Array.from(Object.entries(recipe.metadata)).map(
([key, value]) =>
- key === "source" ? null : (
+ key.toLowerCase() === "source" || key.toLowerCase() === "quelle" ? null : (
<>
<b class="capitalize">{key}</b>:
{value.replace("%", " ")}<br/>
@@ -64,6 +64,7 @@ const source_url = source_url_raw.replace("<", "").replace(">", "");
</ul>
</div>
+ {recipe.cookwares.length > 0 ? (
<div class="box p-4 border border-zinc-300 rounded min-w-[10rem] w-full md:w-auto relative">
<h2 id="geraete">Hilfsmittel</h2>
<ul>
@@ -73,7 +74,8 @@ const source_url = source_url_raw.replace("<", "").replace(">", "");
</li>
))}
</ul>
- </div>
+ </div>) : null}
+
</div>
<h2 id="zubereitung">Zubereitung</h2>
diff --git a/src/content/docs/index.mdoc b/src/content/docs/index.mdoc
@@ -8,7 +8,7 @@ hero:
file: ../../assets/houston.webp
actions:
- text: Rezepte
- link: /recipes/käsekuchen/
+ link: /recipes/
icon: right-arrow
variant: primary
- text: Lese die Anleitung
diff --git a/src/content/docs/recipes/Salzmischungen/Basilikumsalz.mdoc b/src/content/docs/recipes/Salzmischungen/Basilikumsalz.mdoc
@@ -0,0 +1,11 @@
+---
+title: Basilikumsalz
+tableOfContents: false
+---
+
+>> Quelle: Magisch Fix - Jutta Grimm
+>> Produziert: 100-125%g pro Mischung
+>> Aufbewahrung: trocken und dunkel, dicht verschlossen, haltbar mindestens 6 Monate
+
+@Grobes Meersalz{100%g} mit @frischem Basilikum{20%g} und @abgeriebener Zitronenschale{1%TL} pürieren.
+Gut durchtrocknen lassen.
diff --git a/src/content/docs/recipes/Salzmischungen/Tomatensalz.mdoc b/src/content/docs/recipes/Salzmischungen/Tomatensalz.mdoc
@@ -0,0 +1,11 @@
+---
+title: Tomatensalz
+tableOfContents: false
+---
+
+>> Quelle: Magisch Fix - Jutta Grimm
+>> Produziert: 100-125%g pro Mischung
+>> Aufbewahrung: trocken und dunkel, dicht verschlossen, haltbar mindestens 6 Monate
+
+@Grobes Meersalz{100%g} mit @getrockneten Tomaten{25%g} und @getrockneter Oregano{1%TL} pürieren.
+Gut durchtrocknen lassen.
diff --git a/src/content/docs/recipes/index.mdoc b/src/content/docs/recipes/index.mdoc
@@ -0,0 +1,3 @@
+---
+title: Rezepte
+---
+\ No newline at end of file
diff --git a/src/content/docs/recipes/käsekuchen.mdoc b/src/content/docs/recipes/käsekuchen.mdoc
@@ -1,18 +0,0 @@
----
-title: Käsekuchen
-tableOfContents: false
----
-
->> source: <https://www.jamieoliver.com/recipes/eggs-recipes/easy-pancakes/>
-
-Crack the @eggs{3} into a blender, then add the @flour{125%g}, @milk{250%ml} and @sea salt{1%pinch}, and blitz until smooth.
-
-Pour into a #bowl and leave to stand for ~{15%minutes}.
-
-Melt the @butter (or a drizzle of @oil if you want to be a bit healthier) in a #large non-stick frying pan{} on a medium heat, then tilt the pan so the butter coats the surface.
-
-Pour in 1 ladle of batter and tilt again, so that the batter spreads all over the base, then cook for 1 to 2 minutes, or until it starts to come away from the sides.
-
-Once golden underneath, flip the pancake over and cook for 1 further minute, or until cooked through.
-
-Serve straightaway with your favourite topping. -- Add your favorite topping here to make sure it's included in your meal plan!
diff --git a/src/content/docs/recipes/test.mdoc b/src/content/docs/recipes/test.mdoc
@@ -1,20 +0,0 @@
----
-title: Test
-tableOfContents: false
----
->> servings: 1
->> produce: 240%g
->> calories: 345%kkal
->> protein: 23%g
->> total fat: 24%g
->> total carb.: 6%g
-
-Preheat the oven to 180 degrees.
-
-Finely dice @red bell pepper{30%g}, @courgette{30%g}, @tomatoes{30%g} and grate the @mozzarella cheese{30%g}.
-
-Beat the @eggs{2} in a #bowl and add the @double cream{30%g}, @salt{1/4%tsp} and @pepper{1/4%tsp} and whisk well with a fork.
-
-Add the vegetables to the egg mixture and pour it into the #pan, sprinkle with cheese and place in the oven to bake for ~{7%minutes}.
-
-Take an #oven mitt{} and remove the pan from the oven, fold the omelette in half and place on a plate. Garnish with finely chopped fresh parsley and serve with a relish or chutney.