From: MatthewOwens <matthew@owens.tech>
Date: Thu, 16 Jul 2020 16:20:51 +0000 (+0100)
Subject: added script to generate title tag from post markdown heading
X-Git-Url: https://git.owens.tech///git?a=commitdiff_plain;h=75f4597272f8c92c8d06b54be05e4aec4ce6782a;p=website.git

added script to generate title tag from post markdown heading
---

diff --git a/scripts/post_title.sh b/scripts/post_title.sh
new file mode 100755
index 0000000..19ca5d5
--- /dev/null
+++ b/scripts/post_title.sh
@@ -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>"