homepage/tmpl/mdwntohtml

24 lines
449 B
Bash
Executable File

#! /bin/sh
while IFS=: read field value; do
case "$field" in
"")
break
;;
Title)
# echo strips leading and trailing whitespace
title=${value# }
;;
esac
done
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'