fix: normalized slugs for recipes

This commit is contained in:
Leyla Becker 2026-02-22 11:05:52 -06:00
parent 72b26472c3
commit 928e7aecff
21 changed files with 40 additions and 29 deletions

View file

@ -5,8 +5,8 @@ makes: 1 cake
## Ingredients
- [ ] 3 apples
- [ ] [Caramel Upside Down Cake Topping](/recipe/Caramel Upside Down Cake Topping/)
- [ ] [Upside Down Cake Batter](/recipe/Upside Down Cake Batter/)
- [ ] [Caramel Upside Down Cake Topping](/recipe/caramel-upside-down-cake-topping/)
- [ ] [Upside Down Cake Batter](/recipe/upside-down-cake-batter/)
- [ ] oil for pan
## Tools
- 8 inch x 8 inch baking pan

View file

@ -6,7 +6,7 @@ title: Apple Streusel
- [ ] apples 4 - 8
- [ ] brown sugar
- [ ] all purpose flour
- [ ] [cinnamon streusel](Cinnamon%20Streusel)
- [ ] [cinnamon streusel](/recipe/cinnamon-streusel/)
## Tools
- dutch oven
## Steps

View file

@ -10,7 +10,7 @@ title: Chicken Noodle Soup
- [ ] carrots 3-4 sticks
- [ ] onion
- [ ] 10 cups broth
- [ ] [Egg Noodles (rough draft)](/recipe/Egg Noodles/) uncooked
- [ ] [Egg Noodles (rough draft)](/recipe/egg-noodles/) uncooked
- [ ] garlic 2 cloves
- [ ] salt
- [ ] black pepper

View file

@ -13,7 +13,7 @@ makes: 1 Bundt Cake
- [ ] eggs 2
- [ ] vanilla extract to taste
- [ ] butter/pam to grease pan
- [ ] [cinnamon streusel](Cinnamon%20Streusel)
- [ ] [cinnamon streusel](/recipe/cinnamon-streusel/)
## Tools
- stove
- mixing bowl

View file

@ -15,8 +15,8 @@ title: Enchiladas
- [ ] red chili powder
- [ ] cumin
- [ ] large tortillas [^1]
- [ ] [Chili White Sauce](/recipe/Chili White Sauce/)
- [ ] [Red pasta sauce (rough draft)](/recipe/Red pasta sauce/)
- [ ] [Chili White Sauce](/recipe/chili-white-sauce/)
- [ ] [Red pasta sauce (rough draft)](/recipe/red-pasta-sauce/)
- [ ] oil to grease pan
## Tools
- pan

View file

@ -3,7 +3,7 @@ title: Fettuccine
---
## Ingredients
- [ ] [Rolled Pasta Dough (non-vegan)](/recipe/Rolled Pasta Dough (non-vegan)/) Sheets width 6
- [ ] [Rolled Pasta Dough (non-vegan)](/recipe/rolled-pasta-dough-non-vegan/) Sheets width 6
- [ ] water
- [ ] salt
## Tools

View file

@ -6,7 +6,7 @@ aliases:
---
## Ingredients
- [ ] day old [White Long Grain Rice](/recipe/White Long Grain Rice/)
- [ ] day old [White Long Grain Rice](/recipe/white-long-grain-rice/)
- [ ] mustard seeds
- [ ] sesame seeds
- [ ] cumin seeds

View file

@ -6,7 +6,7 @@ draft: true
## Ingredients
- [ ] instant ramen - chicken 1 packet
- [ ] nori (sea weed) 1 sheet
- [ ] [soft boiled eggs](Soft%20Boiled%20Eggs%20(rough%20draft).md) 2 eggs
- [ ] [soft boiled eggs](/recipe/soft-boiled-eggs-rough-draft/) 2 eggs
- [ ] narutomaki (cured fish cakes) 3 slices
- [ ] carrots
- [ ] celery

View file

@ -4,7 +4,7 @@ draft: true
---
## Ingredients
- [ ] [Kombucha Scoby](/recipe/Kombucha Scoby/) 6 parts by volume
- [ ] [Kombucha Scoby](/recipe/kombucha-scoby/) 6 parts by volume
- [ ] fruit puree 1 part by volume
- [ ] rhubarb 1 part by weight
- [ ] raspberry 2 parts by weight

View file

@ -27,4 +27,4 @@ draft: true
[^1]: can be substituted with store bought kombucha for first scoby
[^2]: tap water works but is slower and has a higher chance of failure due to chlorine/fluoride in water
[^3]: sweet to sour balance matches [Kombucha Calibrator](/recipe/Kombucha Calibrator/) or ph is below then 4.0
[^3]: sweet to sour balance matches [Kombucha Calibrator](/recipe/kombucha-calibrator/) or ph is below then 4.0

View file

@ -4,7 +4,7 @@ draft: true
---
## Ingredients
- [ ] [Kombucha Scoby](/recipe/Kombucha Scoby/) 6 parts by volume
- [ ] [Kombucha Scoby](/recipe/kombucha-scoby/) 6 parts by volume
- [ ] fruit puree 1 part by volume
## Tools
- blender

View file

@ -5,9 +5,9 @@ makes: 1 dish of pasta
---
## Ingredients
- [ ] [rolled pasta dough](/recipe/Rolled Pasta Dough (non-vegan)/)
- [ ] [soffritto](/recipe/Soffritto/)
- [ ] [béchamel](/recipe/chamel/)
- [ ] [rolled pasta dough](/recipe/rolled-pasta-dough-non-vegan/)
- [ ] [soffritto](/recipe/soffritto/)
- [ ] [béchamel](/recipe/bechamel/)
- [ ] parmesan
- [ ] provola (provolone)
- [ ] mushroom

View file

@ -5,7 +5,7 @@ makes: 6 25 cm pizzas
## notes
- can be stored in fridge for up to 3 days
## Ingredients
- [ ] [Pizza Biga](/recipe/Pizza Biga/)
- [ ] [Pizza Biga](/recipe/pizza-biga/)
- [ ] cold water 210g
- [ ] salt 25g
- [ ] malt 10g [^1]

View file

@ -5,7 +5,7 @@ draft: true
### notes
- try some lemon juice
## Ingredients
- [ ] [soffritto](Soffritto.md)
- [ ] [soffritto](/recipe/soffritto/)
- [ ] rosemary
- [ ] thyme
- [ ] parsley

View file

@ -2,7 +2,7 @@
title: "Stuffing"
---
## Ingredients
- [ ] stale [bread](Bread.md) 1 loaf
- [ ] stale [bread](/recipe/bread/) 1 loaf
- [ ] carrot 2 large roots
- [ ] celery 4 stalks
- [ ] white onion 1

View file

@ -5,8 +5,8 @@ title: "Tikka Masala Paneer"
- fenugreek can be substituted with coriander leaves
- paneer cooks better with convection set high
## Ingredients
- [ ] [Tikka Marinade](/recipe/Tikka Marinade/)
- [ ] [Tikka Masala Gravy](/recipe/Tikka Masala Gravy/)
- [ ] [Tikka Marinade](/recipe/tikka-marinade-paneer/)
- [ ] [Tikka Masala Gravy](/recipe/tikka-masala-gravy/)
- [ ] heavy cream 6 tablespoons
- [ ] fenugreek
## Tools

View file

@ -5,7 +5,7 @@ makes: 1 mug
### notes
- Alcohol can be omitted for virgin T&J's
## Ingredients
- [ ] [Tom and Jerry Mix](/recipe/Tom and Jerry Mix/) 40g
- [ ] [Tom and Jerry Mix](/recipe/tom-and-jerry-mix/) 40g
- [ ] spiced rum 25g
- [ ] milk 240g
## Tools

View file

@ -4,8 +4,8 @@ title: "Tortellini"
### notes
-
## Ingredients
- [ ] [Rolled Pasta Dough](/recipe/Rolled Pasta Dough/)
- [ ] [Mushroom Pasta Filling (rough draft)](/recipe/Mushroom Pasta Filling/)
- [ ] [Rolled Pasta Dough](/recipe/rolled-pasta-dough/)
- [ ] [Mushroom Pasta Filling (rough draft)](/recipe/mushroom-pasta-filling/)
## Tools
- knife
- pot

View file

@ -8,7 +8,7 @@ draft: true
- [ ] water 1 table spoon
- [ ] white miso paste 1 tablespoon
- [ ] onion powder 2 teaspoons
- [ ] [Chicken Broth Powder](/recipe/Chicken Broth Powder/) 2 teaspoons
- [ ] [Chicken Broth Powder](/recipe/chicken-broth-powder/) 2 teaspoons
- [ ] garlic powder 1 teaspoon
- [ ] liquid smoke 1 teaspoon
- [ ] apple vinegar vinegar 1 teaspoon

View file

@ -3,7 +3,7 @@ title: "Turnover Pastry"
draft: true
---
## Ingredients
- [ ] [Turnover Dough](/recipe/Turnover Dough/)
- [ ] [Turnover Dough](/recipe/turnover-dough/)
- [ ] Jam or Filling
## Tools
- sheet pan

View file

@ -41,6 +41,17 @@ const getPlantBased = (filePath) => {
return null;
}
const slugify = (text) => {
return text
.toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with hyphens
.replace(/[()]/g, '') // Remove parentheses
.replace(/[^\w-]+/g, '') // Remove non-word chars except hyphens
.replace(/--+/g, '-') // Replace multiple hyphens with single hyphen
.replace(/^-+/, '') // Trim hyphens from start
.replace(/-+$/, ''); // Trim hyphens from end
}
const getSlugFromPath = (filePath) => {
// Normalize the path - remove leading ./ if present
const normalizedPath = filePath.startsWith('./') ? filePath.slice(2) : filePath;
@ -54,12 +65,12 @@ const getSlugFromPath = (filePath) => {
const secondPart = parts[1];
// If it's a .md file at the top level (recipes/foo.md), strip the extension
if (secondPart.endsWith('.md')) {
return path.basename(secondPart, '.md');
return slugify(path.basename(secondPart, '.md'));
}
// Otherwise it's a folder name (recipes/bar/v1.md -> bar)
return secondPart;
return slugify(secondPart);
}
return path.basename(filePath, '.md');
return slugify(path.basename(filePath, '.md'));
}
const getTitleFromSlug = (slug) => {