From c1e387f2f84014cc7872b5cfcc5865fd2db2b968 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 10 Jul 2022 14:17:39 +0200 Subject: Write recipes in markdown and transform with pandoc --- bin/build | 15 +++++++++++++++ bin/dev-server | 17 +++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100755 bin/build create mode 100755 bin/dev-server (limited to 'bin') diff --git a/bin/build b/bin/build new file mode 100755 index 0000000..ab6db24 --- /dev/null +++ b/bin/build @@ -0,0 +1,15 @@ +#!/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 "Done!" diff --git a/bin/dev-server b/bin/dev-server new file mode 100755 index 0000000..45a51fc --- /dev/null +++ b/bin/dev-server @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Serve public + +fuser -k 8000/tcp || true +python -m http.server --directory public 8000 & +trap "fuser -k 8000/tcp" EXIT + +# Build HTML recipes on changes + +watchexec \ + --clear \ + --restart \ + --watch recettes \ + --watch template.html \ + "bin/build" -- cgit v1.2.3