From 2ea173ec64afaf0921e3876e095bf53fed2ca545 Mon Sep 17 00:00:00 2001 From: Steph Enders Date: Fri, 4 Nov 2022 14:52:54 -0400 Subject: Work on creating via a markdown [wip] --- compile-md.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 compile-md.sh (limited to 'compile-md.sh') 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 -- cgit v1.2.3-54-g00ecf