From 75f4597272f8c92c8d06b54be05e4aec4ce6782a Mon Sep 17 00:00:00 2001
From: MatthewOwens <matthew@owens.tech>
Date: Thu, 16 Jul 2020 17:20:51 +0100
Subject: [PATCH] added script to generate title tag from post markdown heading

---
 scripts/post_title.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100755 scripts/post_title.sh

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>"
-- 
2.20.1