2020-07-31 14:12:36 +00:00
|
|
|
#!/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..."
|
|
|
|
|
2020-07-31 22:43:15 +00:00
|
|
|
pandoc --from gfm <src/$fn >$BOOPTMP
|
2020-07-31 14:12:36 +00:00
|
|
|
cp template/page.html $NEWF
|
|
|
|
|
|
|
|
sed "/<body>/r $BOOPTMP" template/page.html > $NEWF
|
|
|
|
|
|
|
|
sed -i "s/XFSSTITLE/$TITLE/" $NEWF
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|