#!/bin/sh
header='
'
genhtml() (
cd "$1"
. ./meta.sh
exec 1>index.html
# Header
echo "
$title"
echo ""
echo "$header"
[ "$1" != . ] && echo "$blog_title
"
# Body
pandoc *.md
# Footer
[ "$1" != . ] && echo "
From: $author, $date"
)
for d in *; do
[ -d "$d" ] && genhtml "$d"
done
genhtml .
# Fix for mastodon.
sed '/mstdn/s/href=/rel="me" href=/' index.html >xx && mv xx index.html
# Put a license in index footer.
echo '
Unless otherwise noted, posts are licensed under
CC BY 4.0.' >>index.html