summaryrefslogtreecommitdiff
path: root/compile-md.sh
diff options
context:
space:
mode:
authorSteph Enders <smenders@gmail.com>2022-11-04 14:52:54 -0400
committerSteph Enders <smenders@gmail.com>2022-11-04 14:52:54 -0400
commit2ea173ec64afaf0921e3876e095bf53fed2ca545 (patch)
tree6c42c863ce15e56b5d7322d54394d01cd78bac64 /compile-md.sh
parentd0b5b23a75801a7fb6cbc38730d7f171793dcf84 (diff)
Work on creating via a markdown [wip]
Diffstat (limited to 'compile-md.sh')
-rwxr-xr-xcompile-md.sh32
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