diff options
author | Joris | 2023-03-08 09:06:47 +0100 |
---|---|---|
committer | Joris | 2023-03-08 09:06:47 +0100 |
commit | 15562b8bcc17d590285d0442c292fbba32229e05 (patch) | |
tree | 422943ec87ee582f77fb98fc3d82d708e0cb3771 | |
parent | ebbeae447bf4a205329d8bebb3dbe02614b64a90 (diff) |
Generate public/index.html
-rw-r--r-- | .gitignore | 1 | ||||
-rwxr-xr-x | bin/build | 31 | ||||
-rw-r--r-- | public/index.html | 75 |
3 files changed, 32 insertions, 75 deletions
@@ -1 +1,2 @@ public/recettes +public/index.html @@ -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> |