mirror of
https://github.com/nicholaswilde/recipes.git
synced 2026-05-02 20:06:47 +00:00
310 lines
21 KiB
Python
310 lines
21 KiB
Python
import os
|
|
import re
|
|
|
|
# Comprehensive mapping of filenames to their new sub-paths
|
|
link_mapping = {
|
|
# Sides
|
|
"america's-test-kitchen-best-baked-potatoes.md": "potatoes/america's-test-kitchen-best-baked-potatoes.md",
|
|
"america's-test-kitchen-best-baked-sweet-potatoes.md": "potatoes/america's-test-kitchen-best-baked-sweet-potatoes.md",
|
|
"amish-potato-salad.md": "potatoes/amish-potato-salad.md",
|
|
"cheesy-potatoes.md": "potatoes/cheesy-potatoes.md",
|
|
"crispy-herbes-de-provence-potatoes.md": "potatoes/crispy-herbes-de-provence-potatoes.md",
|
|
"french-potato-salad.md": "potatoes/french-potato-salad.md",
|
|
"funeral-potatoes.md": "potatoes/funeral-potatoes.md",
|
|
"golden-french-mashed-potatoes.md": "potatoes/golden-french-mashed-potatoes.md",
|
|
"greek-style-lemon-roasted-potatoes.md": "potatoes/greek-style-lemon-roasted-potatoes.md",
|
|
"ina-garten's-potato-salad.md": "potatoes/ina-garten's-potato-salad.md",
|
|
"internet-famous-crispy-potatoes.md": "potatoes/internet-famous-crispy-potatoes.md",
|
|
"joel-robuchons-mashed-potatoes.md": "potatoes/joel-robuchons-mashed-potatoes.md",
|
|
"julia-child's-garlic-mashed-potatoes.md": "potatoes/julia-child's-garlic-mashed-potatoes.md",
|
|
"loaded-vegan-potato-skins.md": "potatoes/loaded-vegan-potato-skins.md",
|
|
"pommes-dauphine.md": "potatoes/pommes-dauphine.md",
|
|
"pommes-mont-d'or.md": "potatoes/pommes-mont-d'or.md",
|
|
"potato-au-gratin.md": "potatoes/potato-au-gratin.md",
|
|
"potato-salad.md": "potatoes/potato-salad.md",
|
|
"scalloped-potatoes.md": "potatoes/scalloped-potatoes.md",
|
|
"tater-tots.md": "potatoes/tater-tots.md",
|
|
"the-best-crispy-roast-potatoes-ever-recipe.md": "potatoes/the-best-crispy-roast-potatoes-ever-recipe.md",
|
|
"tortilla-de-patatas.md": "potatoes/tortilla-de-patatas.md",
|
|
"vegan-mashed-potatoes.md": "potatoes/vegan-mashed-potatoes.md",
|
|
|
|
"asparagus-purée.md": "vegetables/asparagus-purée.md",
|
|
"braised-asparagus-with-lemon-and-chives.md": "vegetables/braised-asparagus-with-lemon-and-chives.md",
|
|
"brown-sugar-and-spice-roasted-carrots.md": "vegetables/brown-sugar-and-spice-roasted-carrots.md",
|
|
"brussels-sprouts-with-warm-honey-glaze.md": "vegetables/brussels-sprouts-with-warm-honey-glaze.md",
|
|
"buffalo-baked-baby-carrots.md": "vegetables/buffalo-baked-baby-carrots.md",
|
|
"buffalo-cauliflower-wings.md": "vegetables/buffalo-cauliflower-wings.md",
|
|
"butter-basted-grilled-mushrooms.md": "vegetables/butter-basted-grilled-mushrooms.md",
|
|
"cauliflower-purée-with-thyme.md": "vegetables/cauliflower-purée-with-thyme.md",
|
|
"charred-brussels-sprouts-with-walnuts-&-gorgonzola.md": "vegetables/charred-brussels-sprouts-with-walnuts-&-gorgonzola.md",
|
|
"cilantro-almond-pesto-brussels-sprouts.md": "vegetables/cilantro-almond-pesto-brussels-sprouts.md",
|
|
"creamed-spinach.md": "vegetables/creamed-spinach.md",
|
|
"fried-green-tomatoes.md": "vegetables/fried-green-tomatoes.md",
|
|
"garlic-and-lemon-roasted-romanesco-cauliflower.md": "vegetables/garlic-and-lemon-roasted-romanesco-cauliflower.md",
|
|
"garlic-mushrooms.md": "vegetables/garlic-mushrooms.md",
|
|
"grilled-mushrooms-with-rosemary-lemon-basting-butter.md": "vegetables/grilled-mushrooms-with-rosemary-lemon-basting-butter.md",
|
|
"grilled-sweet-potatoes-with-chimichurri.md": "vegetables/grilled-sweet-potatoes-with-chimichurri.md",
|
|
"hasselback-roasted-zucchini.md": "vegetables/hasselback-roasted-zucchini.md",
|
|
"honey-glazed-carrots-and-parsnips.md": "vegetables/honey-glazed-carrots-and-parsnips.md",
|
|
"ina-garten's-parmesan-roasted-broccoli.md": "vegetables/ina-garten's-parmesan-roasted-broccoli.md",
|
|
"jalapeño-corn-pudding.md": "vegetables/jalapeño-corn-pudding.md",
|
|
"kale-chips.md": "vegetables/kale-chips.md",
|
|
"kickstarter-garlic-mushrooms.md": "vegetables/kickstarter-garlic-mushrooms.md",
|
|
"kickstarter-lemony-roasted-cauliflower.md": "vegetables/kickstarter-lemony-roasted-cauliflower.md",
|
|
"lemon-garlic-cauliflower-rice.md": "vegetables/lemon-garlic-cauliflower-rice.md",
|
|
"maple-harissa-glazed-sweet-potatoes.md": "vegetables/maple-harissa-glazed-sweet-potatoes.md",
|
|
"maple-roasted-brussels-sprouts-with-pumpkin-seeds.md": "vegetables/maple-roasted-brussels-sprouts-with-pumpkin-seeds.md",
|
|
"maple-roasted-carrots-with-tahini-and-pomegranate.md": "vegetables/maple-roasted-carrots-with-tahini-and-pomegranate.md",
|
|
"mashed-sweet-potatoes-with-caramelized-shallots.md": "vegetables/mashed-sweet-potatoes-with-caramelized-shallots.md",
|
|
"miso-glazed-bok-choy.md": "vegetables/miso-glazed-bok-choy.md",
|
|
"miso-glazed-carrots.md": "vegetables/miso-glazed-carrots.md",
|
|
"mushroom-medley.md": "vegetables/mushroom-medley.md",
|
|
"parsnip-purée.md": "vegetables/parsnip-purée.md",
|
|
"pea-purée.md": "vegetables/pea-purée.md",
|
|
"roasted-delicata-squash.md": "vegetables/roasted-delicata-squash.md",
|
|
"roasted-fennel-with-garlic-and-thyme.md": "vegetables/roasted-fennel-with-garlic-and-thyme.md",
|
|
"sautéed-mushrooms.md": "vegetables/sautéed-mushrooms.md",
|
|
"skillet-steamed-haricots-verts.md": "vegetables/skillet-steamed-haricots-verts.md",
|
|
"spicy-garlic-edamame.md": "vegetables/spicy-garlic-edamame.md",
|
|
"steamed-broccoli-with-vinaigrette.md": "vegetables/steamed-broccoli-with-vinaigrette.md",
|
|
"vegetable-casserole.md": "vegetables/vegetable-casserole.md",
|
|
"zesty-roasted-vegetables.md": "vegetables/zesty-roasted-vegetables.md",
|
|
|
|
"basmati-pilaf.md": "grains-and-legumes/basmati-pilaf.md",
|
|
"black-beans.md": "grains-and-legumes/black-beans.md",
|
|
"black-eyed-peas-and-greens.md": "grains-and-legumes/black-eyed-peas-and-greens.md",
|
|
"brazilian-rice.md": "grains-and-legumes/brazilian-rice.md",
|
|
"corn-tortillas.md": "grains-and-legumes/corn-tortillas.md",
|
|
"couscous.md": "grains-and-legumes/couscous.md",
|
|
"fried-green-plantains.md": "grains-and-legumes/fried-green-plantains.md",
|
|
"garlic-rice.md": "grains-and-legumes/garlic-rice.md",
|
|
"gracias-madre-black-beans.md": "grains-and-legumes/gracias-madre-black-beans.md",
|
|
"green-rice.md": "grains-and-legumes/green-rice.md",
|
|
"pearl-couscous.md": "grains-and-legumes/pearl-couscous.md",
|
|
"quinoa.md": "grains-and-legumes/quinoa.md",
|
|
"refried-black-beans.md": "grains-and-legumes/refried-black-beans.md",
|
|
"vegan-baked-beans.md": "grains-and-legumes/vegan-baked-beans.md",
|
|
|
|
"andrew-kings-pasta-salad.md": "salads/andrew-kings-pasta-salad.md",
|
|
"balsamic-dressed-cucumber-with-olives.md": "salads/balsamic-dressed-cucumber-with-olives.md",
|
|
"beach-day-chickpea-salad.md": "salads/beach-day-chickpea-salad.md",
|
|
"blueberry-chickpea-salad.md": "salads/blueberry-chickpea-salad.md",
|
|
"eggless-egg-salad.md": "salads/eggless-egg-salad.md",
|
|
"fiesta-salad.md": "salads/fiesta-salad.md",
|
|
"lemony-broccoli-salad-with-chickpeas-&-feta.md": "salads/lemony-broccoli-salad-with-chickpeas-&-feta.md",
|
|
"macaroni-salad.md": "salads/macaroni-salad.md",
|
|
"mexican-coleslaw.md": "salads/mexican-coleslaw.md",
|
|
"pasta-salad.md": "salads/pasta-salad.md",
|
|
"red-cabbage-salad.md": "salads/red-cabbage-salad.md",
|
|
"spicy-cashew-quinoa-salad.md": "salads/spicy-cashew-quinoa-salad.md",
|
|
"spinach-salad-with-gorgonzola-and-pear.md": "salads/spinach-salad-with-gorgonzola-and-pear.md",
|
|
"three-bean-salad.md": "salads/three-bean-salad.md",
|
|
"tomato-feta-pasta-salad.md": "salads/tomato-feta-pasta-salad.md",
|
|
"tomato-salad.md": "salads/tomato-salad.md",
|
|
"vegan-caesar-salad.md": "salads/vegan-caesar-salad.md",
|
|
"vegan-kale-caesar-with-crispy-chickpeas.md": "salads/vegan-kale-caesar-with-crispy-chickpeas.md",
|
|
"vegan-ricotta-&-sun-dried-tomato-pesto-salad.md": "salads/vegan-ricotta-&-sun-dried-tomato-pesto-salad.md",
|
|
|
|
"banana-chips.md": "snacks/banana-chips.md",
|
|
"bow-tie-pasta-chips.md": "snacks/bow-tie-pasta-chips.md",
|
|
"caprese-flatbread.md": "snacks/caprese-flatbread.md",
|
|
"carrot-cake-protein-bites.md": "snacks/carrot-cake-protein-bites.md",
|
|
"carrot-slaw.md": "snacks/carrot-slaw.md",
|
|
"cheese-soufflé.md": "snacks/cheese-soufflé.md",
|
|
"cheesy-popcorn.md": "snacks/cheesy-popcorn.md",
|
|
"club-crackers.md": "snacks/club-crackers.md",
|
|
"deviled-eggs.md": "snacks/deviled-eggs.md",
|
|
"dried-fruit-and-nut-mix.md": "snacks/dried-fruit-and-nut-mix.md",
|
|
"falafel-scones-with-harissa-yogurt.md": "snacks/falafel-scones-with-harissa-yogurt.md",
|
|
"fennel-and-potato-cassola.md": "snacks/fennel-and-potato-cassola.md",
|
|
"granola-bars.md": "snacks/granola-bars.md",
|
|
"honey-and-walnut-baked-brie.md": "snacks/honey-and-walnut-baked-brie.md",
|
|
"honey-roasted-peanuts.md": "snacks/honey-roasted-peanuts.md",
|
|
"hummus-with-pesto.md": "snacks/hummus-with-pesto.md",
|
|
"josh-elkin's-mushroom-toast.md": "snacks/josh-elkin's-mushroom-toast.md",
|
|
"kettle-corn.md": "snacks/kettle-corn.md",
|
|
"kroket.md": "snacks/kroket.md",
|
|
"laugenbrezeln-(german-lye-pretzels).md": "snacks/laugenbrezeln-(german-lye-pretzels).md",
|
|
"madre-crab-cakes.md": "snacks/madre-crab-cakes.md",
|
|
"no-bake-sunshine-energy-bites.md": "snacks/no-bake-sunshine-energy-bites.md",
|
|
"peanut-butter-bites.md": "snacks/peanut-butter-bites.md",
|
|
"peanut-butter-chocolate-chip-protein-bites.md": "snacks/peanut-butter-chocolate-chip-protein-bites.md",
|
|
"pickled-red-onions.md": "snacks/pickled-red-onions.md",
|
|
"ritz-crackers.md": "snacks/ritz-crackers.md",
|
|
"roasted-chickpea-snack.md": "snacks/roasted-chickpea-snack.md",
|
|
"rosemary-roasted-cashews.md": "snacks/rosemary-roasted-cashews.md",
|
|
"scottish-oatcakes.md": "snacks/scottish-oatcakes.md",
|
|
"strawberry-protein-bites.md": "snacks/strawberry-protein-bites.md",
|
|
"unsweetened-applesauce.md": "snacks/unsweetened-applesauce.md",
|
|
|
|
# Sauces
|
|
"béchamel.md": "mother-sauces/béchamel.md",
|
|
"espagnole.md": "mother-sauces/espagnole.md",
|
|
"hollandaise.md": "mother-sauces/hollandaise.md",
|
|
"tomate.md": "mother-sauces/tomate.md",
|
|
"velouté.md": "mother-sauces/velouté.md",
|
|
|
|
"all-purpose-vinaigrette.md": "vinaigrettes/all-purpose-vinaigrette.md",
|
|
"broccoli-salad-dressing.md": "vinaigrettes/broccoli-salad-dressing.md",
|
|
"cilantro-dressing.md": "vinaigrettes/cilantro-dressing.md",
|
|
"citrus-honey-dressing.md": "vinaigrettes/citrus-honey-dressing.md",
|
|
"creamy-cilantro-dressing.md": "vinaigrettes/creamy-cilantro-dressing.md",
|
|
"french-dressing.md": "vinaigrettes/french-dressing.md",
|
|
"honey-mustard-vinaigrette.md": "vinaigrettes/honey-mustard-vinaigrette.md",
|
|
"hummus-orange-juice-dressing.md": "vinaigrettes/hummus-orange-juice-dressing.md",
|
|
"ina-garten's-perfect-vinaigrette.md": "vinaigrettes/ina-garten's-perfect-vinaigrette.md",
|
|
"italian-vinaigrette.md": "vinaigrettes/italian-vinaigrette.md",
|
|
"jane's-3,-2,-1-salad-dressing.md": "vinaigrettes/jane's-3,-2,-1-salad-dressing.md",
|
|
"orange-juice-lime-salad-dressing.md": "vinaigrettes/orange-juice-lime-salad-dressing.md",
|
|
"pizzeria-vinaigrette.md": "vinaigrettes/pizzeria-vinaigrette.md",
|
|
"red-wine-vinaigrette.md": "vinaigrettes/red-wine-vinaigrette.md",
|
|
"rip's-salad-dressing.md": "vinaigrettes/rip's-salad-dressing.md",
|
|
"roasted-red-pepper-dressing.md": "vinaigrettes/roasted-red-pepper-dressing.md",
|
|
"strawberry-tarragon-dressing.md": "vinaigrettes/strawberry-tarragon-dressing.md",
|
|
"sumac-lemon-vinaigrette.md": "vinaigrettes/sumac-lemon-vinaigrette.md",
|
|
"vinaigrette.md": "vinaigrettes/vinaigrette.md",
|
|
|
|
"aaron-combs'-salsa.md": "salsas/aaron-combs'-salsa.md",
|
|
"pumpkin-seed-salsa.md": "salsas/pumpkin-seed-salsa.md",
|
|
"salsa-brava.md": "salsas/salsa-brava.md",
|
|
"salsa-fresca-(pico-de-gallo).md": "salsas/salsa-fresca-(pico-de-gallo).md",
|
|
"salsa-macha.md": "salsas/salsa-macha.md",
|
|
"salsa-negra.md": "salsas/salsa-negra.md",
|
|
"salsa-ranchera.md": "salsas/salsa-ranchera.md",
|
|
"salsa-roja.md": "salsas/salsa-roja.md",
|
|
"salsa-verde.md": "salsas/salsa-verde.md",
|
|
"sweet-and-spicy-corn-salsa.md": "salsas/sweet-and-spicy-corn-salsa.md",
|
|
|
|
"aji-verde.md": "dips-and-spreads/aji-verde.md",
|
|
"balsamic-onion-jam.md": "dips-and-spreads/balsamic-onion-jam.md",
|
|
"beet-hummus.md": "dips-and-spreads/beet-hummus.md",
|
|
"benedictine-sandwich-spread.md": "dips-and-spreads/benedictine-sandwich-spread.md",
|
|
"blue-cheese-herb-spread.md": "dips-and-spreads/blue-cheese-herb-spread.md",
|
|
"cashew-chipotle-ranch-dressing.md": "dips-and-spreads/cashew-chipotle-ranch-dressing.md",
|
|
"cashew-crema.md": "dips-and-spreads/cashew-crema.md",
|
|
"cashew-nacho-cheese.md": "dips-and-spreads/cashew-nacho-cheese.md",
|
|
"cashew-queso-blanco.md": "dips-and-spreads/cashew-queso-blanco.md",
|
|
"chipotle-mayonnaise.md": "dips-and-spreads/chipotle-mayonnaise.md",
|
|
"chipotle-ranch-dressing.md": "dips-and-spreads/chipotle-ranch-dressing.md",
|
|
"claire's-five-onion-dip.md": "dips-and-spreads/claire's-five-onion-dip.md",
|
|
"edamame-hummus.md": "dips-and-spreads/edamame-hummus.md",
|
|
"green-goddess-dressing.md": "dips-and-spreads/green-goddess-dressing.md",
|
|
"hearts-of-palm-ceviche.md": "dips-and-spreads/hearts-of-palm-ceviche.md",
|
|
"homemade-ranch-dip.md": "dips-and-spreads/homemade-ranch-dip.md",
|
|
"hummus.md": "dips-and-spreads/hummus.md",
|
|
"mayonnaise.md": "dips-and-spreads/mayonnaise.md",
|
|
"mexicrema-dressing.md": "dips-and-spreads/mexicrema-dressing.md",
|
|
"oil-free-easy-french-hummus-dressing.md": "dips-and-spreads/oil-free-easy-french-hummus-dressing.md",
|
|
"oil-free-hummus.md": "dips-and-spreads/oil-free-hummus.md",
|
|
"persian-yogurt-dip-with-shallots-(mast-o-musir).md": "dips-and-spreads/persian-yogurt-dip-with-shallots-(mast-o-musir).md",
|
|
"ranch-dip.md": "dips-and-spreads/ranch-dip.md",
|
|
"ranch-dressing.md": "dips-and-spreads/ranch-dressing.md",
|
|
"roasted-garlic-hummus.md": "dips-and-spreads/roasted-garlic-hummus.md",
|
|
"spinach-dip.md": "dips-and-spreads/spinach-dip.md",
|
|
"tahini.md": "dips-and-spreads/tahini.md",
|
|
"tofu-mayonnaise.md": "dips-and-spreads/tofu-mayonnaise.md",
|
|
"tzatziki-dip.md": "dips-and-spreads/tzatziki-dip.md",
|
|
"tzatziki-sauce.md": "dips-and-spreads/tzatziki-sauce.md",
|
|
"vegan-caesar-dressing.md": "dips-and-spreads/vegan-caesar-dressing.md",
|
|
"vegan-chipotle-ranch-dressing.md": "dips-and-spreads/vegan-chipotle-ranch-dressing.md",
|
|
"vegan-ranch-dressing.md": "dips-and-spreads/vegan-ranch-dressing.md",
|
|
"vegan-sour-cream.md": "dips-and-spreads/vegan-sour-cream.md",
|
|
"whipped-almond-ricotta.md": "dips-and-spreads/whipped-almond-ricotta.md",
|
|
|
|
"berry-sauce.md": "sweet-sauces/berry-sauce.md",
|
|
"crème-anglaise.md": "sweet-sauces/crème-anglaise.md",
|
|
"hot-fudge-sauce.md": "sweet-sauces/hot-fudge-sauce.md",
|
|
"mixed-berry-coulis.md": "sweet-sauces/mixed-berry-coulis.md",
|
|
"salted-caramel-sauce.md": "sweet-sauces/salted-caramel-sauce.md",
|
|
"simple-berry-compote.md": "sweet-sauces/simple-berry-compote.md",
|
|
"single-jar-of-fruit-jam.md": "sweet-sauces/single-jar-of-fruit-jam.md",
|
|
"sweet-and-spicy-ketchup.md": "sweet-sauces/sweet-and-spicy-ketchup.md",
|
|
|
|
"adobo-sauce.md": "gravy-and-savory-sauces/adobo-sauce.md",
|
|
"alfredo-sauce.md": "gravy-and-savory-sauces/alfredo-sauce.md",
|
|
"applied-homemade-vegetarian-gravy.md": "gravy-and-savory-sauces/applied-homemade-vegetarian-gravy.md",
|
|
"arrabbiata-sauce.md": "gravy-and-savory-sauces/arrabbiata-sauce.md",
|
|
"asian-sweet-and-sour-sauce.md": "gravy-and-savory-sauces/asian-sweet-and-sour-sauce.md",
|
|
"a-very-popular-bbq-sauce.md": "gravy-and-savory-sauces/a-very-popular-bbq-sauce.md",
|
|
"buffalo-sauce.md": "gravy-and-savory-sauces/buffalo-sauce.md",
|
|
"butternut-squash-sauce.md": "gravy-and-savory-sauces/butternut-squash-sauce.md",
|
|
"carrot-tamarind-chutney.md": "gravy-and-savory-sauces/carrot-tamarind-chutney.md",
|
|
"chilero-hot-sauce.md": "gravy-and-savory-sauces/chilero-hot-sauce.md",
|
|
"chimichurri.md": "gravy-and-savory-sauces/chimichurri.md",
|
|
"classic-mustard.md": "gravy-and-savory-sauces/classic-mustard.md",
|
|
"classic-tartar-sauce.md": "gravy-and-savory-sauces/classic-tartar-sauce.md",
|
|
"creamy-peanut-tofu-marinade.md": "gravy-and-savory-sauces/creamy-peanut-tofu-marinade.md",
|
|
"creamy-vegan-cheese-sauce.md": "gravy-and-savory-sauces/creamy-vegan-cheese-sauce.md",
|
|
"dijon-mustard.md": "gravy-and-savory-sauces/dijon-mustard.md",
|
|
"enchilada-sauce.md": "gravy-and-savory-sauces/enchilada-sauce.md",
|
|
"garlic-aioli.md": "gravy-and-savory-sauces/garlic-aioli.md",
|
|
"homemade-chilli-oil.md": "gravy-and-savory-sauces/homemade-chilli-oil.md",
|
|
"honey-mustard-dipping-sauce.md": "gravy-and-savory-sauces/honey-mustard-dipping-sauce.md",
|
|
"indian-mango-chutney.md": "gravy-and-savory-sauces/indian-mango-chutney.md",
|
|
"lebanese-garlic-sauce-(toum).md": "gravy-and-savory-sauces/lebanese-garlic-sauce-(toum).md",
|
|
"magnolia-ranchero-sauce.md": "gravy-and-savory-sauces/magnolia-ranchero-sauce.md",
|
|
"maple-soy-tofu-marinade.md": "gravy-and-savory-sauces/maple-soy-tofu-marinade.md",
|
|
"marinara-sauce.md": "gravy-and-savory-sauces/marinara-sauce.md",
|
|
"miso-glaze.md": "gravy-and-savory-sauces/miso-glaze.md",
|
|
"mushroom-gravy.md": "gravy-and-savory-sauces/mushroom-gravy.md",
|
|
"mushroom-sauce.md": "gravy-and-savory-sauces/mushroom-sauce.md",
|
|
"new-york-style-pizza-sauce.md": "gravy-and-savory-sauces/new-york-style-pizza-sauce.md",
|
|
"new-york-times'-classic-marinara-sauce.md": "gravy-and-savory-sauces/new-york-times'-classic-marinara-sauce.md",
|
|
"peanut-dipping-sauce.md": "gravy-and-savory-sauces/peanut-dipping-sauce.md",
|
|
"pumpkin-curry-sauce.md": "gravy-and-savory-sauces/pumpkin-curry-sauce.md",
|
|
"roasted-red-pepper-coulis.md": "gravy-and-savory-sauces/roasted-red-pepper-coulis.md",
|
|
"roasted-red-pepper-sauce.md": "gravy-and-savory-sauces/roasted-red-pepper-sauce.md",
|
|
"simple-barbecue-sauce.md": "gravy-and-savory-sauces/simple-barbecue-sauce.md",
|
|
"simple-tartar-sauce.md": "gravy-and-savory-sauces/simple-tartar-sauce.md",
|
|
"spaghetti-sauce.md": "gravy-and-savory-sauces/spaghetti-sauce.md",
|
|
"special-sauce-for-burgers.md": "gravy-and-savory-sauces/special-sauce-for-burgers.md",
|
|
"spicy-vegan-mayo.md": "gravy-and-savory-sauces/spicy-vegan-mayo.md",
|
|
"thai-red-curry-tofu-marinade.md": "gravy-and-savory-sauces/thai-red-curry-tofu-marinade.md",
|
|
"the-soyfoods-council-chimichurri.md": "gravy-and-savory-sauces/the-soyfoods-council-chimichurri.md",
|
|
"tomato-bruschetta.md": "gravy-and-savory-sauces/tomato-bruschetta.md",
|
|
"tomato-ragu.md": "gravy-and-savory-sauces/tomato-ragu.md",
|
|
"tomato-sauce.md": "gravy-and-savory-sauces/tomato-sauce.md",
|
|
"vegetarian-sausage-gravy.md": "gravy-and-savory-sauces/vegetarian-sausage-gravy.md",
|
|
"white-mac-and-cheese-sauce.md": "gravy-and-savory-sauces/white-mac-and-cheese-sauce.md",
|
|
|
|
# Pesto sub-folder under gravy
|
|
"balsamic-pesto.md": "gravy-and-savory-sauces/pesto/balsamic-pesto.md",
|
|
"basic-pesto.md": "gravy-and-savory-sauces/pesto/basic-pesto.md",
|
|
"broccoli-pesto.md": "gravy-and-savory-sauces/pesto/broccoli-pesto.md",
|
|
"cilantro-almond-pesto.md": "gravy-and-savory-sauces/pesto/cilantro-almond-pesto.md",
|
|
"cook's-country-perfect-pesto.md": "gravy-and-savory-sauces/pesto/cook's-country-perfect-pesto.md",
|
|
"jalapeño-lime-pesto.md": "gravy-and-savory-sauces/pesto/jalapeño-lime-pesto.md",
|
|
"joy-of-cooking-pesto.md": "gravy-and-savory-sauces/pesto/joy-of-cooking-pesto.md",
|
|
"lemon-arugula-pesto.md": "gravy-and-savory-sauces/pesto/lemon-arugula-pesto.md",
|
|
"lemon-pepper-parsley-pesto.md": "gravy-and-savory-sauces/pesto/lemon-pepper-parsley-pesto.md",
|
|
"mascarpone-pesto.md": "gravy-and-savory-sauces/pesto/mascarpone-pesto.md",
|
|
"sun-dried-tomato-pesto.md": "gravy-and-savory-sauces/pesto/sun-dried-tomato-pesto.md"
|
|
}
|
|
|
|
def fix_links(root_dir):
|
|
for dirpath, _, filenames in os.walk(root_dir):
|
|
for filename in filenames:
|
|
if filename.endswith(".md"):
|
|
filepath = os.path.join(dirpath, filename)
|
|
with open(filepath, 'r') as f:
|
|
content = f.read()
|
|
|
|
new_content = content
|
|
for old_file, new_path in link_mapping.items():
|
|
# Match links to sides/old_file or sauces-and-dressings/old_file
|
|
# We use lookbehind to avoid matching already fixed links
|
|
# Pattern for relative links like ../sides/recipe.md
|
|
pattern_sides = r'(?<!/)(sides)/' + re.escape(old_file)
|
|
pattern_sauces = r'(?<!/)(sauces-and-dressings)/' + re.escape(old_file)
|
|
|
|
new_content = re.sub(pattern_sides, r'sides/' + new_path, new_content)
|
|
new_content = re.sub(pattern_sauces, r'sauces-and-dressings/' + new_path, new_content)
|
|
|
|
if new_content != content:
|
|
with open(filepath, 'w') as f:
|
|
f.write(new_content)
|
|
print(f"Fixed links in: {filepath}")
|
|
|
|
if __name__ == "__main__":
|
|
fix_links("docs")
|