added gen_posts
authorMatthewOwens <matthew@owens.tech>
Fri, 17 Jul 2020 20:15:14 +0000 (21:15 +0100)
committerMatthewOwens <matthew@owens.tech>
Fri, 17 Jul 2020 20:15:14 +0000 (21:15 +0100)
scripts/gen_post.sh [new file with mode: 0755]

diff --git a/scripts/gen_post.sh b/scripts/gen_post.sh
new file mode 100755 (executable)
index 0000000..c4aa79e
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+[ $# -ne 1 ] && exit 1
+
+title=$(scripts/post_title.sh $1)
+
+# since $title will have a closing HTML tag, we need to use a different
+# seperator to '/' for sed
+sed "s|TITLE|$title|" includes/head.html
+cat includes/header.html
+markdown $1