diff options
Diffstat (limited to 'compile-md.sh')
-rwxr-xr-x | compile-md.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/compile-md.sh b/compile-md.sh new file mode 100755 index 0000000..f79f742 --- /dev/null +++ b/compile-md.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +set -ex + +if [ $# -ne 3 ]; then + echo "./compile-md.sh [page|blog] [in.md] [out.html]" + exit 1 +fi + +in=$2 +out=$3 + +if [ $1 == "blog" ]; then + cat templates/blog-header.html > $out +else + if [ $1 == "page" ]; then + cat templates/page-header.html > $out + else + echo "Missing first parameter: [page|blog]" + exit 1 + fi +fi + +markdown $in >> $out + +if [ $1 == "blog" ]; then + cat templates/blog-footer.html >> $out +else + cat templates/page-footer.html >> $out +fi + +./tidy.sh $out |