feed-the-void/site-files/make-page.sh

12 lines
477 B
Bash
Raw Normal View History

#!/usr/bin/env bash
set -e
2023-11-21 11:53:00 -06:00
dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
2023-11-21 12:10:02 -06:00
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
2023-11-21 11:53:00 -06:00
chmod 777 $dir/../output
2023-11-21 12:10:02 -06:00
sed "s/output here/$(sed 's/\//\\\//g' $dir/../output)/g" $dir/tmp.html >$dir/index.html
sleep 1
2023-11-21 11:53:00 -06:00
done