diff --git a/docs/no-image-has-fm.csv b/docs/no-image-has-fm.csv index cf66876..e8dcfdb 100644 --- a/docs/no-image-has-fm.csv +++ b/docs/no-image-has-fm.csv @@ -8,31 +8,31 @@ Bang Bang Tofu.cook|bang-bang-tofu Barbecue Chicken with Crispy Pan-Fried Okra & Cheddar Biscuits.cook|barbecue-chicken-with-crispy-pan-fried-okra-cheddar-biscuits Black Bean and Corn Salad.cook|black-bean-and-corn-salad Blackened Shrimp and Gouda Grits.cook|blackened-shrimp-and-gouda-grits -Butternut Turkey Chili.cook|butternut-turkey-chili +Butternut Turkey Chili.cook|butternut-turkey-chili-2 BUTTERNUT & TURKEY CHILI with sweet peppers, spiced pepitas & queso fresco.cook|butternut-turkey-chili-with-sweet-peppers-spiced-pepitas-queso-fresco Cabbage_Salad.cook|cabbage-salad cauliflower-milanese.cook|cauliflower-milanese Chana Chickpea Salad.cook|chana-chickpea-salad Chicken and Pumpkin Gnocchi with Ricotta.cook|chicken-and-pumpkin-gnocchi-with-ricotta Chickpea Butter Curry.cook|chickpea-butter-curry -Chickpea_Butter_Curry.cook|chickpea-butter-curry +Chickpea_Butter_Curry.cook|chickpea-butter-curry-2 Chinese Orange Shrimp.cook|chinese-orange-shrimp Chocolate_Mousse_Cake_with_Raspberries.cook|chocolate-mousse-cake-with-raspberries Cilantro Pesto Shrimp Over Orzo.cook|cilantro-pesto-shrimp-over-orzo Crispy Roasted Chickpeas (Garbanzo Beans).cook|crispy-roasted-chickpeas-garbanzo-beans -Crispy_Roasted_Chickpeas_(Garbanzo_Beans).cook|crispy-roasted-chickpeas-garbanzo-beans +Crispy_Roasted_Chickpeas_(Garbanzo_Beans).cook|crispy-roasted-chickpeas-garbanzo-beans-2 Dried Fava Soup.cook|dried-fava-soup Easy Lemon Rosemary White Bean Soup.cook|easy-lemon-rosemary-white-bean-soup -Easy_Lemon_Rosemary_White_Bean_Soup.cook|easy-lemon-rosemary-white-bean-soup +Easy_Lemon_Rosemary_White_Bean_Soup.cook|easy-lemon-rosemary-white-bean-soup-2 Gaja's Bulgogi Lettuce Wraps.cook|gaja-s-bulgogi-lettuce-wraps Gochugaru Honey Salmon.cook|gochugaru-honey-salmon -Indian Spiced Chicken.cook|indian-spiced-chicken +Indian Spiced Chicken.cook|indian-spiced-chicken-2 Kale and Chestnut Stew.cook|kale-and-chestnut-stew Kkanpoong Tofu.cook|kkanpoong-tofu Korean Shrimp Tacos.cook|korean-shrimp-tacos Kung Pao Shrimp with Sichuan Roasted Green Beans.cook|kung-pao-shrimp-with-sichuan-roasted-green-beans Lactation cookies.cook|lactation-cookies -Lactation_cookies.cook|lactation-cookies +Lactation_cookies.cook|lactation-cookies-2 Moroccan_Spiced_Lentil_and_Chickpea_Soup.cook|moroccan-spiced-lentil-and-chickpea-soup Moroccan Spiced Lentil & Chickpea Soup.cook|moroccan-spiced-lentil-chickpea-soup Orange Rolls.cook|orange-rolls diff --git a/docs/plans/2026-05-21-recipe-images-plan.md b/docs/plans/2026-05-21-recipe-images-plan.md index 253f3e0..c172bc9 100644 --- a/docs/plans/2026-05-21-recipe-images-plan.md +++ b/docs/plans/2026-05-21-recipe-images-plan.md @@ -4,7 +4,7 @@ **Goal:** Give every `.cook` recipe file an `image:` field in YAML frontmatter pointing to `https://roux.roo.lol/recipe-images/.webp`, and download each image locally. -**Architecture:** Three parallel batches — (1) relink the 19 existing images, (2) discover + download + link 48 missing images (recipes with frontmatter), (3) create frontmatter + discover + link 9 more (recipes without frontmatter). Use subagent parallel dispatch for image discovery to keep wall-clock time manageable. +**Architecture:** Three parallel batches — (1) relink the 19 existing images, (2) discover + download + link 50 missing images (recipes with frontmatter), (3) create frontmatter + discover + link 9 more (recipes without frontmatter). Use subagent parallel dispatch for image discovery to keep wall-clock time manageable. **Tech Stack:** bash, curl, ImageMagick (convert), subagent researcher for web image search @@ -13,50 +13,56 @@ ### Task 0: Setup — slug map, image dir, helper script **Files:** -- Create: `/home/jbrechtel/recipes/docs/slugs.csv` -- Modify: none yet +- Create: `docs/slugs.csv` +- Create: `docs/has-image.csv` +- Create: `docs/no-image-has-fm.csv` +- Create: `docs/no-fm.csv` - [ ] **Step 1: Generate slug mapping** -Run a one-liner that prints every `.cook` file with its slugified stem: +Run a one-liner that prints every `.cook` file with its slugified stem, then deduplicate any collisions: ```bash -cd /home/jbrechtel/recipes +cd /home/jbrechtel/recipes/.worktrees/recipe-images for f in *.cook; do stem="${f%.cook}" slug=$(echo "$stem" \ | tr '[:upper:]' '[:lower:]' \ | sed -e 's/[^a-z0-9]/-/g' -e 's/--*/-/g' -e 's/^-//' -e 's/-$//') echo "$f|$slug" -done > docs/slugs.csv -head docs/slugs.csv +done | awk -F'|' ' +{ + slug=$2 + count[slug]++ + if (count[slug] > 1) { + slug = slug "-" count[slug] + } + print $1 "|" slug +}' > docs/slugs.csv ``` -Expected: a pipe-delimited CSV like `Alain-Ducase-Bread.cook|alain-ducase-bread`. +Total: 78 unique slugs (6 duplicate pairs get `-2` suffix). - [ ] **Step 2: Create image directory** ```bash -mkdir -p /home/jbrechtel/recipes/recipe-images +mkdir -p recipe-images ``` - [ ] **Step 3: Classify each recipe** ```bash -cd /home/jbrechtel/recipes -echo "=== Already has image ===" +cd /home/jbrechtel/recipes/.worktrees/recipe-images while IFS='|' read -r f slug; do if grep -q "^image:" "$f" 2>/dev/null; then echo "$f|$slug"; fi done < docs/slugs.csv > docs/has-image.csv -echo "=== Has frontmatter, no image ===" while IFS='|' read -r f slug; do if head -1 "$f" 2>/dev/null | grep -q "^---"; then if ! grep -q "^image:" "$f" 2>/dev/null; then echo "$f|$slug"; fi fi done < docs/slugs.csv > docs/no-image-has-fm.csv -echo "=== No frontmatter ===" while IFS='|' read -r f slug; do if ! head -1 "$f" 2>/dev/null | grep -q "^---"; then echo "$f|$slug"; fi done < docs/slugs.csv > docs/no-fm.csv @@ -64,12 +70,11 @@ done < docs/slugs.csv > docs/no-fm.csv wc -l docs/has-image.csv docs/no-image-has-fm.csv docs/no-fm.csv ``` -Expected: 19 / 48 / 9 lines respectively. +Expected: 19 / 50 / 9 = 78 total. - [ ] **Step 4: Commit setup** ```bash -cd /home/jbrechtel/recipes git add docs/slugs.csv docs/has-image.csv docs/no-image-has-fm.csv docs/no-fm.csv git commit -m "chore: add recipe slug mapping and classification CSVs" ``` diff --git a/docs/slugs.csv b/docs/slugs.csv index bd8c3b4..20b4814 100644 --- a/docs/slugs.csv +++ b/docs/slugs.csv @@ -12,7 +12,7 @@ Blackened Shrimp and Gouda Grits.cook|blackened-shrimp-and-gouda-grits Black Pepper Tofu (Ottolenghi).cook|black-pepper-tofu-ottolenghi Black Pepper Tofu with Bok Choy.cook|black-pepper-tofu-with-bok-choy butternut-turkey-chili.cook|butternut-turkey-chili -Butternut Turkey Chili.cook|butternut-turkey-chili +Butternut Turkey Chili.cook|butternut-turkey-chili-2 BUTTERNUT & TURKEY CHILI with sweet peppers, spiced pepitas & queso fresco.cook|butternut-turkey-chili-with-sweet-peppers-spiced-pepitas-queso-fresco Butter Tofu.cook|butter-tofu Cabbage_Salad.cook|cabbage-salad @@ -25,16 +25,16 @@ Chana Chickpea Salad.cook|chana-chickpea-salad Chana Salad.cook|chana-salad Chicken and Pumpkin Gnocchi with Ricotta.cook|chicken-and-pumpkin-gnocchi-with-ricotta Chickpea Butter Curry.cook|chickpea-butter-curry -Chickpea_Butter_Curry.cook|chickpea-butter-curry +Chickpea_Butter_Curry.cook|chickpea-butter-curry-2 Chinese Orange Shrimp.cook|chinese-orange-shrimp Chocolate_Mousse_Cake_with_Raspberries.cook|chocolate-mousse-cake-with-raspberries Cilantro Pesto Shrimp Over Orzo.cook|cilantro-pesto-shrimp-over-orzo Crispy Roasted Chickpeas (Garbanzo Beans).cook|crispy-roasted-chickpeas-garbanzo-beans -Crispy_Roasted_Chickpeas_(Garbanzo_Beans).cook|crispy-roasted-chickpeas-garbanzo-beans +Crispy_Roasted_Chickpeas_(Garbanzo_Beans).cook|crispy-roasted-chickpeas-garbanzo-beans-2 Crispy Tofu With Cashews and Blistered Snap Peas.cook|crispy-tofu-with-cashews-and-blistered-snap-peas Dried Fava Soup.cook|dried-fava-soup Easy Lemon Rosemary White Bean Soup.cook|easy-lemon-rosemary-white-bean-soup -Easy_Lemon_Rosemary_White_Bean_Soup.cook|easy-lemon-rosemary-white-bean-soup +Easy_Lemon_Rosemary_White_Bean_Soup.cook|easy-lemon-rosemary-white-bean-soup-2 Easy Vegetarian Chili.cook|easy-vegetarian-chili example-fried-rice.cook|example-fried-rice Fettucine with spiced cherry tomato sauce.cook|fettucine-with-spiced-cherry-tomato-sauce @@ -42,14 +42,14 @@ Gaja's Bulgogi Lettuce Wraps.cook|gaja-s-bulgogi-lettuce-wraps Gochugaru Honey Salmon.cook|gochugaru-honey-salmon Green_Beans_with_Lemon_and_Garlic.cook|green-beans-with-lemon-and-garlic indian-spiced-chicken.cook|indian-spiced-chicken -Indian Spiced Chicken.cook|indian-spiced-chicken +Indian Spiced Chicken.cook|indian-spiced-chicken-2 Italian Sausage and Delicata Rigatoni.cook|italian-sausage-and-delicata-rigatoni Kale and Chestnut Stew.cook|kale-and-chestnut-stew Kkanpoong Tofu.cook|kkanpoong-tofu Korean Shrimp Tacos.cook|korean-shrimp-tacos Kung Pao Shrimp with Sichuan Roasted Green Beans.cook|kung-pao-shrimp-with-sichuan-roasted-green-beans Lactation cookies.cook|lactation-cookies -Lactation_cookies.cook|lactation-cookies +Lactation_cookies.cook|lactation-cookies-2 Lentil Soup with Lemon and Turmeric.cook|lentil-soup-with-lemon-and-turmeric Moroccan_Spiced_Lentil_and_Chickpea_Soup.cook|moroccan-spiced-lentil-and-chickpea-soup Moroccan Spiced Lentil & Chickpea Soup.cook|moroccan-spiced-lentil-chickpea-soup