added script to generate title tag from post markdown heading
authorMatthewOwens <matthew@owens.tech>
Thu, 16 Jul 2020 16:20:51 +0000 (17:20 +0100)
committerMatthewOwens <matthew@owens.tech>
Thu, 16 Jul 2020 16:20:51 +0000 (17:20 +0100)
scripts/post_title.sh [new file with mode: 0755]

diff --git a/scripts/post_title.sh b/scripts/post_title.sh
new file mode 100755 (executable)
index 0000000..19ca5d5
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+if [ $# -ne 1 ]; then
+       t="fallback title"
+else
+       t=$(sed -rn 's/^#([^#])/\1/p' $1)
+       t=$(echo $t | sed 's/ //g')
+fi
+
+echo "<title>$t</title>"