projects
/
website.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c39c43a
)
added script to generate title tag from post markdown heading
author
MatthewOwens
<matthew@owens.tech>
Thu, 16 Jul 2020 16:20:51 +0000
(17:20 +0100)
committer
MatthewOwens
<matthew@owens.tech>
Thu, 16 Jul 2020 16:20:51 +0000
(17:20 +0100)
scripts/post_title.sh
[new file with mode: 0755]
patch
|
blob
diff --git a/scripts/post_title.sh
b/scripts/post_title.sh
new file mode 100755
(executable)
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>"