From 15562b8bcc17d590285d0442c292fbba32229e05 Mon Sep 17 00:00:00 2001
From: Joris
Date: Wed, 8 Mar 2023 09:06:47 +0100
Subject: Generate public/index.html
---
bin/build | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
(limited to 'bin')
diff --git a/bin/build b/bin/build
index ab6db24..cf1009d 100755
--- a/bin/build
+++ b/bin/build
@@ -12,4 +12,35 @@ for RECIPE in recettes/**/*.md; do
done
+echo "Building index…"
+
+echo "
+
+
+
+
+
+
+
+
Recettes
+" > public/index.html
+
+function section {
+ SECTION_TITLE="$1"
+ RECIPE_PATH="$2"
+
+ echo "$SECTION_TITLE
" >> public/index.html
+ for RECIPE in $RECIPE_PATH; do
+ TITLE=$(cat "$RECIPE" | head -n 1)
+ echo "- ${TITLE:2}" >> public/index.html
+ done
+ echo "
" >> 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!"
--
cgit v1.2.3