summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2022-05-28 18:40:46 +0100
committerPaul Buetow <paul@buetow.org>2022-05-28 18:40:46 +0100
commit6d02279c3526d00ca63164f89e6bdbbee9828520 (patch)
treea4691a5e133c0896c2986ba6552550fcc377e1a1 /lib
parent5bfde8ea85c1e95bdbdef5784c8a67d5df6ead2e (diff)
automatically use top level HTML stylesheet
Diffstat (limited to 'lib')
-rw-r--r--lib/generate.source.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/generate.source.sh b/lib/generate.source.sh
index d988fde..dedbe31 100644
--- a/lib/generate.source.sh
+++ b/lib/generate.source.sh
@@ -98,7 +98,13 @@ generate::_fromgmi () {
if [[ -z "$title" ]]; then
title=$SUBTITLE
fi
- $SED -i "s|%%TITLE%%|$title|g; s|%%DOMAIN%%|$DOMAIN|g" "$dest.tmp"
+
+ local stylesheet="$(basename "$HTML_CSS_STYLE")"
+ if [[ "$dest" =~ gemfeed ]]; then
+ stylesheet="../$stylesheet"
+ fi
+ $SED -i "s|%%TITLE%%|$title|g;s|%%DOMAIN%%|$DOMAIN|g;s|%%STYLESHEET%%|$stylesheet|g;" \
+ "$dest.tmp"
mv "$dest.tmp" "$dest"
git::add "$format" "$dest"
@@ -121,10 +127,7 @@ generate::fromgmi () {
log INFO "Converted $num_gmi_files Gemtext files"
- # Add CSS style sheet (for html only). For simplicity, copy style sheet
- # file to ./ and to ./gemfeed directories (not to mess with file paths too much).
cp $HTML_CSS_STYLE $CONTENT_BASE_DIR/gemtext/style.css
- cp $HTML_CSS_STYLE $CONTENT_BASE_DIR/gemtext/gemfeed/style.css
# Add non-.gmi files to html dir.
log VERBOSE "Adding other docs to $*"