2009-11-10 22:06:12 -07:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
while IFS=: read field value; do
|
|
|
|
case "$field" in
|
|
|
|
"")
|
|
|
|
break
|
|
|
|
;;
|
|
|
|
Title)
|
|
|
|
# echo strips leading and trailing whitespace
|
2012-09-11 23:23:44 -06:00
|
|
|
title=${value# }
|
2009-11-10 22:06:12 -07:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2015-03-20 18:32:15 -06:00
|
|
|
tmpl=$(dirname $0)
|
|
|
|
|
|
|
|
printf '<!DOCTYPE html>\n'
|
|
|
|
printf '<html lang="en">\n'
|
|
|
|
sed "s~TITLE~$title~" $tmpl/head.tmpl
|
|
|
|
printf "<body><h1>%s</h1>\n" "$title"
|
|
|
|
markdown
|
|
|
|
cat $tmpl/foot.tmpl
|
|
|
|
printf '</body></html>\n'
|