build: experiment: create static html from markdown

This commit is contained in:
Florian Warzecha 2024-05-10 23:01:11 +02:00
parent 4b9d623a4c
commit 327fede0fb
Signed by: liketechnik
GPG key ID: 4BE8C7D97F910C60
2 changed files with 14 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
out/

13
make_static.sh Executable file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env bash
# TODO: use nix shebang?!
if [ -d out ]
then
echo "ERROR: out already exists"
exit 1
fi
mkdir out
find . -type d '!' -path './.git/*' '!' -name .git '!' -name out '!' -path './out/*' '!' -name '.' -exec mkdir 'out/{}' ';'
find . -type f -name '*.md' '!' -path './out/*' -exec bash -c 'i="$1"; pandoc -f markdown -s -t html "$i" > $(echo "out/${i%.md}.html")' sh {} ';'
(cd out && tree -o index.html -H .)