build: experiment: create static html from markdown #1
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
out/
|
13
make_static.sh
Executable file
13
make_static.sh
Executable 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 .)
|
Loading…
Reference in a new issue