summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorPaul Buetow <git@mx.buetow.org>2021-05-18 08:50:24 +0100
committerPaul Buetow <git@mx.buetow.org>2021-05-21 05:11:05 +0100
commitd371050f2fb79b6d66a810e60ff9c0ed2381f2cc (patch)
tree7fab42e3388fcf5c4f5c92d65f916098c43b5591 /packages
parent6aee04354e443e2121bf6c558be227388a10e7b2 (diff)
dynamic html title
Diffstat (limited to 'packages')
-rw-r--r--packages/generate.source.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/generate.source.sh b/packages/generate.source.sh
index e74d2995..248fe6c4 100644
--- a/packages/generate.source.sh
+++ b/packages/generate.source.sh
@@ -84,6 +84,9 @@ generate::_fromgmi () {
md::fromgmi < "$src" >> "$dest.tmp"
fi
+ local title=$($SED -n '/^# / { s/# //; p; q; }' "$src" | tr '"' "'")
+ test -z "title" && title=$SUBTITLE
+ $SED -i "s|%%TITLE%%|$title|g" "$dest.tmp"
mv "$dest.tmp" "$dest"
test "$ADD_GIT" == yes && git add "$dest"
}