diff options
| author | Paul Buetow <git@mx.buetow.org> | 2021-05-18 08:50:24 +0100 |
|---|---|---|
| committer | Paul Buetow <git@mx.buetow.org> | 2021-05-18 08:50:24 +0100 |
| commit | 8c06578156462751ffb90bcb21ae6632a92958c1 (patch) | |
| tree | 24e8c0f5576437ea8b961799479d3c8679e26c9b /packages | |
| parent | 3ef6d46bf8f86dcb2bb40abcb61f8f31847cc419 (diff) | |
dynamic html title
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/generate.source.sh | 3 |
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" } |
