Converting Recipes to CookBook Format
Converts recipes from various sources into standardized CookBook format with complete nutritional information and FODMAP details.
When to Use
- •User provides a recipe URL (Instagram, YouTube, website)
- •User pastes recipe text to convert
- •User asks to "create a recipe" or "add a recipe"
- •Recipe needs proper formatting for the Hugo cookbook site
Output Location
Create new recipe files in content/queued/ directory.
Required Front Matter Structure
--- draft: false readyToTest: true queued: true title: "Recipe Title" author: "Source Name or Policzone Szamy" recipe_image: images/recipe-headers/filename.avif video_file: videos/filename.mp4 # Optional date: YYYY-MM-DDTHH:mm:ss+00:00 categories: # One of: śniadania, obiady, kolacje, desery, przekąska, napoje, sosy subcategories: # Optional: słodkie, wytrawne, etc. tags: [] # See tag rules below tagline: "Brief, appetizing description" ingredients: [] # See ingredient rules below servings: 4 prep_time: 20 cook: true cook_time: 30 calories: 500 protein: 35 fat: 20 carbohydrate: 45 link: https://source-url.com # Optional fodmap: status: "yes" # or "no" serving_ok: "OK w tej porcji" # or "Tylko mała porcja" or "Unikaj" notes: "Safety notes for FODMAP diet" substitutions: [] # Array of substitution suggestions ---
Content Structure
Składniki Section
Organize ingredients into subsections when applicable:
## Składniki ### Ciasto - ingredient list ### Nadzienie - ingredient list ### Sos - ingredient list
For simple recipes without components, use flat list:
## Składniki - 500 g ingredient - 2 łyżki another ingredient
Sposób przygotowania Section
## Sposób przygotowania 1. First step with details 2. Second step 3. Continue numbering sequentially
Nutritional Table
ALWAYS include complete nutritional breakdown:
## Podsumowanie wartości odżywczych (całe danie) | Składnik | Ilość (g) | Kalorie (kcal) | Białko (g) | Tłuszcze (g) | Węglowodany (g) | |--------------------|-----------|----------------|------------|--------------|-----------------| | Ingredient 1 | 400 | 660 | 124.0 | 14.4 | 0.0 | | Ingredient 2 | 200 | 666 | 14.8 | 0.9 | 146.2 | | **RAZEM:** | **600** | **1326** | **138.8** | **15.3** | **146.2** | ---
Tag Rules (CRITICAL)
Tags describe recipe type or use case, NOT ingredients.
Allowed tags (from static/admin/config.yml):
- •Type: kanapki, batony, kotlety, włoskie, meksykańskie, marokański
- •Use: szybkie, przekąska, proteinowe, low carb, lunchbox, goście, jesień, wegańskie, pikantne, słodkie
DO NOT use ingredient tags like "kurczak", "szpinak", "ser" - these go in ingredients field.
Examples:
- •Sandwich recipe:
tags: ["kanapki", "szybkie"] - •Italian dinner:
tags: ["włoskie", "szybkie"] - •Protein dessert:
tags: ["proteinowe", "przekąska"]
Ingredient Rules (CRITICAL)
Include MAIN ingredients only (>30g or structural role).
Include:
- •Proteins: "pierś z kurczaka", "łosoś", "czerwona soczewica", "twaróg półtłusty"
- •Dairy: "mleko 1,5%", "ser cheddar", "jogurt grecki"
- •Main vegetables: "brokuł", "papryka czerwona", "szpinak"
- •Carbs: "ryż basmati", "makaron pełnoziarnisty", "płatki owsiane"
- •Significant fats: "oliwa z oliwek" (≥1 tbsp), "masło orzechowe", "awokado"
- •Bulk items: "mrożone warzywa", "mąka pszenna" (structural)
Exclude:
- •Spices/herbs: sól, pieprz, czosnek, cebula, papryka słodka, chili, zioła
- •Micro amounts: <10g or <1 tsp (cukier, miód, ocet, sok z cytryny)
- •Sprays, baking powder, extracts (unless main ingredient)
Format: ingredients: ["pierś z kurczaka", "ryż basmati", "mrożone warzywa"]
FODMAP Guidelines
Analyze each ingredient for FODMAP safety:
Safe ingredients:
- •Rice, potatoes, meat, fish, eggs
- •Most cheeses (aged), lactose-free dairy
- •Carrots, spinach, tomatoes, zucchini
- •Strawberries, blueberries, oranges
Moderate/High FODMAP:
- •Onion, garlic (use alternatives: chives, garlic oil)
- •Wheat (suggest gluten-free)
- •Beans, lentils (limit portions)
- •Apples, pears, watermelon, dried fruit
- •Honey, agave (use maple syrup)
Set fodmap.status:
- •"yes" = Safe in this portion size
- •"no" = Contains high FODMAP ingredients
Set fodmap.serving_ok:
- •"OK w tej porcji" = Safe as written
- •"Tylko mała porcja" = Reduce serving size
- •"Unikaj" = Not safe for FODMAP diet
Workflow
- •Extract recipe data from source (URL, text, or video)
- •Calculate nutrition using standard food databases
- •Organize ingredients into logical sections (ciasto, nadzienie, etc.)
- •Generate front matter with all required fields
- •Write content following structure above
- •Validate FODMAP safety and add notes
- •Save file as
content/queued/Recipe-Title.md - •Run validation scripts (see Validation section below)
Validation After Conversion
ALWAYS run these validation scripts after creating a recipe file:
1. Validate frontmatter order
python scripts/normalize_frontmatter.py --check
Ensures all frontmatter fields are in correct order.
2. Validate recipe categories
./scripts/sync-recipe-categories.ps1 -CheckOnly
Verifies category matches file location (content/queued/, content/published/obiady/, etc.).
3. Validate CMS config options
python scripts/update_admin_options.py --check
Checks that all tags and options exist in admin config.
Validation workflow:
- •Save the recipe file
- •Run all three validation scripts in sequence
- •If any script reports errors:
- •Read the error message carefully
- •Fix the issues in the recipe file
- •Run validation again
- •Only consider the recipe complete when all validations pass
File Naming
Use title case with hyphens: Pieczony Kurczak z Warzywami.md
Quality Checklist
- • All required front matter fields present
- • Categories from allowed list
- • Tags follow type/use rules (no ingredient tags)
- • Ingredients list contains MAIN items only (no spices)
- • Składniki organized into sections when applicable
- • Nutritional table complete with totals
- • FODMAP analysis thorough with substitutions
- • File saved in
content/queued/ - • Proper Polish language throughout
- • All validation scripts pass without errors
Common Mistakes to Avoid
❌ Adding spices/herbs to ingredients field
❌ Using ingredient names as tags
❌ Missing nutritional breakdown table
❌ Incomplete FODMAP analysis
❌ Saving to wrong directory
❌ Flat ingredient list when sections needed (e.g., pierogi with filling)
Asset URLs
When referencing images or videos, use:
- •
recipe_image: images/recipe-headers/filename.avif - •
video_file: videos/filename.mp4
These paths are processed by Hugo's asset-url.html partial for proper URL handling.