aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rwxr-xr-xbin/build31
-rw-r--r--public/index.html75
3 files changed, 32 insertions, 75 deletions
diff --git a/.gitignore b/.gitignore
index 0527340..0d0f1c1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
public/recettes
+public/index.html
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 "<!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!"
diff --git a/public/index.html b/public/index.html
deleted file mode 100644
index 3269bc3..0000000
--- a/public/index.html
+++ /dev/null
@@ -1,75 +0,0 @@
-<!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>
-
-<h1>Plats</h1>
-
-<ul>
- <li><a href="/recettes/plat/galettes-1.html">Galettes (1)</a>
- <li><a href="/recettes/plat/galettes-2.html">Galettes (2)</a>
- <li><a href="/recettes/plat/lasagnes-vegetariennes.html">Lasagnes végétariennes</a>
- <li><a href="/recettes/plat/pate-amande-coco.html">Pâte amande coco</a>
- <li><a href="/recettes/plat/pate-brisee-complete.html">Pâte brisée complète</a>
- <li><a href="/recettes/plat/pate-brisee.html">Pâte brisée</a>
- <li><a href="/recettes/plat/riz-vinaigre-casserole.html">Riz vinaigré à la casserole</a>
- <li><a href="/recettes/plat/riz-vinaigre-vapeur.html">Riz vinaigré à la vapeur</a>
- <li><a href="/recettes/plat/rouleaux-de-printemps.html">Rouleaux de printemps</a>
- <li><a href="/recettes/plat/soupe-potimarron-butternut.html">Soupe de potimarron et de butternut</a>
- <li><a href="/recettes/plat/taboule.html">Taboulé</a>
- <li><a href="/recettes/plat/tarte-aux-legumes.html">Tarte aux légumes</a>
- <li><a href="/recettes/plat/tartiflette.html">Tartiflette</a>
- <li><a href="/recettes/plat/tortillas.html">Tortillas</a>
-</ul>
-
-<h1>Desserts</h1>
-
-<ul>
- <li><a href="/recettes/dessert/biscuit-caramel-chocolat.html">Biscuit caramel chocolat</a>
- <li><a href="/recettes/dessert/brownie-aux-noix.html">Brownie aux noix</a>
- <li><a href="/recettes/dessert/cake-banane-chocolat.html">Cake banane chocolat</a>
- <li><a href="/recettes/dessert/che-chuoi.html">Che chuôi</a>
- <li><a href="/recettes/dessert/cheesecake.html">Cheesecake</a>
- <li><a href="/recettes/dessert/chocolat-cacahuete.html">Chocolat cacahuète</a>
- <li><a href="/recettes/dessert/cookies.html">Cookies</a>
- <li><a href="/recettes/dessert/creme-au-chocolat.html">Crème au chocolat</a>
- <li><a href="/recettes/dessert/creme-aux-oeufs.html">Crème aux œufs</a>
- <li><a href="/recettes/dessert/crepes.html">Crêpes</a>
- <li><a href="/recettes/dessert/financiers-de-sortosville.html">Financiers de Sortosville</a>
- <li><a href="/recettes/dessert/financiers.html">Financiers</a>
- <li><a href="/recettes/dessert/fondant-au-chocolat.html">Fondant au chocolat</a>
- <li><a href="/recettes/dessert/fudge.html">Fudge</a>
- <li><a href="/recettes/dessert/galette-des-rois.html">Galette des rois</a>
- <li><a href="/recettes/dessert/gateau-aux-noisettes.html">Gâteau aux noisettes</a>
- <li><a href="/recettes/dessert/mousse-au-chocolat.html">Mousse au chocolat</a>
- <li><a href="/recettes/dessert/muffins-vegans-au-chocolat.html">Muffins végans au chocolat</a>
- <li><a href="/recettes/dessert/tiramisu.html">Tiramisu</a>
-</ul>
-
-<h1>Pains</h1>
-
-<ul>
- <li><a href="/recettes/pain/levain.html">Pain au levain</a>
- <li><a href="/recettes/pain/seigle.html">Pain de seigle</a>
- <li><a href="/recettes/pain/epices.html">Pain d’épices</a>
-</ul>
-
-<h1>Nettoyage</h1>
-
-<ul>
- <li><a href="/recettes/nettoyage/lessive-au-lierre.html">Lessive au lierre</a>
- <li><a href="/recettes/nettoyage/lessive-au-savon-de-marseille.html">Lessive au savon de Marseille</a>
- <li><a href="/recettes/nettoyage/produit-vaisselle.html">Produit vaisselle</a>
-</ul>
-
-<h1>Conservation</h1>
-
-<ul>
- <li><a href="/recettes/conservation/lacto-fermentation.html">Lacto-fermentation</a>
-</ul>