xfwc/xfss
2020-07-31 22:43:15 +00:00

19 lines
332 B
Bash
Executable file

#!/bin/bash
BOOPTMP=$(mktemp)
for fn in $(ls src); do
NEWF=${fn%??}html
TITLE=$(echo ${fn%???} | sed 's/_/ /g' | sed -e 's/[]$.*[\^]/\\&/g')
echo "rendering $NEWF..."
pandoc --from gfm <src/$fn >$BOOPTMP
cp template/page.html $NEWF
sed "/<body>/r $BOOPTMP" template/page.html > $NEWF
sed -i "s/XFSSTITLE/$TITLE/" $NEWF
done