feed-the-void/site-files/make-page.sh
2023-11-21 12:10:02 -06:00

12 lines
477 B
Bash
Executable file

#!/usr/bin/env bash
set -e
dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
pandoc -f markdown-smart --data-dir . --template ${dir}/template.html -t html -o $dir/tmp.html $dir/index.md --metadata title="$(grep -m 1 -oP '(?<=^# ).*' $dir/index.md | cat)"
sed -i "s/sourceCode /language-/g" $dir/tmp.html
while true; do
chmod 777 $dir/../output
sed "s/output here/$(sed 's/\//\\\//g' $dir/../output)/g" $dir/tmp.html >$dir/index.html
sleep 1
done