build: experiment: create static html from markdown #1

Closed
liketechnik wants to merge 1 commit from ci/gen-static-html into main
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 .)