diff options
Diffstat (limited to 'bin/build')
-rwxr-xr-x | bin/build | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -12,4 +12,35 @@ for RECIPE in recettes/**/*.md; do done +echo "Building index…" + +echo "<!doctype html> +<html lang="fr"> +<meta charset="utf-8"> +<meta name="viewport" content="width=device-width"> +<link rel="stylesheet" href="/main.css"> +<link rel="icon" href="/icon.png"> +<script src="/main.js"></script> + +<title>Recettes</title> +<header>Recettes</header>" > public/index.html + +function section { + SECTION_TITLE="$1" + RECIPE_PATH="$2" + + echo "<h1>$SECTION_TITLE</h1><ul>" >> public/index.html + for RECIPE in $RECIPE_PATH; do + TITLE=$(cat "$RECIPE" | head -n 1) + echo "<li><a href="${RECIPE%.md}.html">${TITLE:2}</a>" >> public/index.html + done + echo "</ul>" >> 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!" |