#!/usr/bin/env bash set -euo pipefail cd "$(dirname "$0")/.." echo "Building HTML files…" for RECIPE in recettes/**/*.md; do OUT="public/${RECIPE%.md}.html" mkdir -p "$(dirname "$OUT")" pandoc "$RECIPE" --template=template.html -o "$OUT" done echo "Building index…" echo " Recettes
Recettes
" > public/index.html function section { SECTION_TITLE="$1" RECIPE_PATH="$2" echo "

$SECTION_TITLE

" >> public/index.html } section "Plats" "recettes/plat/*.md" section "Desserts" "recettes/dessert/*.md" section "Pains" "recettes/pain/*.md" section "Nettoyage" "recettes/nettoyage/*.md" section "Conservation" "recettes/conservation/*.md" echo "Done!"