Skip to content

Commit 9e6c3ed

Browse files
authored
recipe: add Pea Soup recipe (#6)
1 parent 208878b commit 9e6c3ed

9 files changed

Lines changed: 112 additions & 42 deletions

File tree

biome.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

biome.jsonc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.4.10/schema.json",
3+
"extends": ["@gameroman/config/biome"]
4+
}

bun.lock

Lines changed: 25 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
},
1515
"dependencies": {
1616
"@astrojs/starlight": "^0.38.2",
17-
"astro": "^6.0.8"
17+
"astro": "^6.1.2"
1818
},
1919
"devDependencies": {
20-
"@biomejs/biome": "2.4.8",
21-
"@gameroman/config": "^0.0.3",
22-
"wrangler": "^4.76.0"
20+
"@biomejs/biome": "2.4.10",
21+
"@gameroman/config": "^0.0.5",
22+
"wrangler": "^4.79.0"
2323
},
2424
"overrides": {
2525
"esbuild": "^0.27.4"

src/components/RecipeIngredients.astro

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,30 @@
11
---
2+
type Unit = ("g" | "kg" | "г" | "кг" | "litres" | "литров") | (string & {});
3+
4+
interface AmountRange {
5+
from: number;
6+
to: number;
7+
}
8+
29
interface Ingredient {
310
name: string;
4-
amount: string | number;
5-
unit?: string;
11+
amount: number | AmountRange;
12+
unit?: Unit;
613
}
714
815
interface Props {
916
items: Ingredient[];
1017
}
1118
1219
const { items } = Astro.props;
20+
21+
function getAmount(amount: string | number | AmountRange, unit?: Unit): string {
22+
if (typeof amount === "string" || typeof amount === "number") {
23+
return `${amount} ${unit || ""}`;
24+
}
25+
26+
return `${amount.from} - ${amount.to} ${unit || ""}`;
27+
}
1328
---
1429

1530
<section class="ingredients-container">
@@ -19,9 +34,7 @@ const { items } = Astro.props;
1934
<label class="ingredient-label">
2035
<input type="checkbox" class="ingredient-checkbox" />
2136
<span class="ingredient-text">
22-
<span class="amount">
23-
{item.amount} {item.unit || ""}
24-
</span>
37+
<span class="amount">{getAmount(item.amount, item.unit)}</span>
2538
{item.name}
2639
</span>
2740
</label>
@@ -55,6 +68,7 @@ const { items } = Astro.props;
5568
align-items: center;
5669
padding: 0.75rem 1rem;
5770
cursor: pointer;
71+
margin: 0;
5872
border-bottom: 1px solid var(--sl-color-hairline);
5973
transition: background-color 0.2s ease;
6074
}

src/content/docs/recipes/fried-eggs.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ title: Fried Eggs
33
description: How to make Fried Eggs.
44
---
55

6-
import RecipeIngredients from "#components/RecipeIngredients.astro";
6+
import Ingredients from "#components/RecipeIngredients.astro";
77

88
## Ingredients
99

10-
<RecipeIngredients items={[{ name: "Eggs", amount: 2 }]} />
10+
<Ingredients items={[{ name: "Eggs", amount: 2 }]} />
1111

1212
## Instructions
1313

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: Pea Soup
3+
description: How to make Pea Soup.
4+
---
5+
6+
import Ingredients from "#components/RecipeIngredients.astro";
7+
8+
## Ingredients
9+
10+
<Ingredients
11+
items={[
12+
{ name: "Water", amount: 5, unit: "litres" },
13+
{ name: "Smoked Pork Ribs", amount: 1, unit: "kg" },
14+
{ name: "Peas", amount: 400, unit: "g" },
15+
{ name: "Carrots", amount: 2 },
16+
{ name: "Potatoes", amount: 4 },
17+
{ name: "Onions", amount: 2 },
18+
]}
19+
/>
20+
21+
## Instructions
22+
23+
1. Place the smoked ribs in a pot with the water and begin cooking.
24+
2. Peel and chop the carrots, potatoes, and onions.
25+
3. Sauté the onions and carrots in a pan, then add them to the pot.
26+
4. Cover the pot with a lid and simmer on low heat for 1.5 to 2 hours.
27+
5. Add the peas to the pot and simmer for another hour.
28+
6. Add the potatoes and simmer for a final 30 to 50 minutes until tender.

src/content/docs/ru/recipes/fried-eggs.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ title: Яичница
33
description: Как приготовить яичницу.
44
---
55

6-
import RecipeIngredients from "#components/RecipeIngredients.astro";
6+
import Ingredients from "#components/RecipeIngredients.astro";
77

88
## Ингредиенты
99

10-
<RecipeIngredients items={[{ name: "Яйца", amount: 2 }]} />
10+
<Ingredients items={[{ name: "Яйца", amount: 2 }]} />
1111

1212
## Рецепт
1313

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: Гороховый суп
3+
description: Как приготовить гороховый суп.
4+
---
5+
6+
import Ingredients from "#components/RecipeIngredients.astro";
7+
8+
## Ингредиенты
9+
10+
<Ingredients
11+
items={[
12+
{ name: "Кастрюля с водой", amount: 5, unit: "литров" },
13+
{ name: "Копченые свиные ребрышки", amount: 1, unit: "кг" },
14+
{ name: "Горох", amount: 400, unit: "г" },
15+
{ name: "Морковь", amount: 2 },
16+
{ name: "Картошка", amount: 4 },
17+
{ name: "Лук", amount: 2 },
18+
]}
19+
/>
20+
21+
## Рецепт
22+
23+
1. Поставить варить ребрышки
24+
2. Почистить и порезать морковь, картошку и лук.
25+
3. Обжарить лук и морковь, добавить их в кастрюлю
26+
4. Накрыть кастрюлю крышкой и оставить на слабом огне вариться на 1.5 - 2 часа
27+
5. Добавить горох, и варить ещё час
28+
6. Добавить картошку, и варить ещё 30-50 минут

0 commit comments

Comments
 (0)