From 162363234f8793c50f5628765c163e4976b01d0e Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 17 Sep 2024 00:13:14 +0300 Subject: theme refactoring (not the themes themselves but the structure) --- extras/html/style-business.css | 129 --------------------- extras/html/style-gemfeed-override.css | 0 extras/html/style-notes-override.css | 3 - extras/html/style.css | 129 --------------------- extras/html/themes/business.conf | 8 -- .../themes/business/style-gemfeed-override.css | 0 .../html/themes/business/style-notes-override.css | 3 + extras/html/themes/business/style.css | 129 +++++++++++++++++++++ extras/html/themes/business/theme.conf | 8 ++ extras/html/themes/future.conf | 9 -- .../html/themes/future/style-gemfeed-override.css | 0 extras/html/themes/future/style-notes-override.css | 3 + extras/html/themes/future/style.css | 129 +++++++++++++++++++++ extras/html/themes/future/theme.conf | 9 ++ extras/html/themes/minimal/style.css | 1 + extras/html/themes/minimal/theme.conf | 4 + gemtexter | 27 +++-- gemtexter-paul.buetow.org.conf | 2 +- gemtexter-snonux.foo.conf | 8 +- gemtexter.conf | 2 +- lib/generate.source.sh | 4 +- lib/html.source.sh | 28 ++++- 22 files changed, 330 insertions(+), 305 deletions(-) delete mode 100644 extras/html/style-business.css delete mode 100644 extras/html/style-gemfeed-override.css delete mode 100644 extras/html/style-notes-override.css delete mode 100644 extras/html/style.css delete mode 100644 extras/html/themes/business.conf create mode 100644 extras/html/themes/business/style-gemfeed-override.css create mode 100644 extras/html/themes/business/style-notes-override.css create mode 100644 extras/html/themes/business/style.css create mode 100644 extras/html/themes/business/theme.conf delete mode 100644 extras/html/themes/future.conf create mode 100644 extras/html/themes/future/style-gemfeed-override.css create mode 100644 extras/html/themes/future/style-notes-override.css create mode 100644 extras/html/themes/future/style.css create mode 100644 extras/html/themes/future/theme.conf create mode 100644 extras/html/themes/minimal/style.css create mode 100644 extras/html/themes/minimal/theme.conf diff --git a/extras/html/style-business.css b/extras/html/style-business.css deleted file mode 100644 index 3fbbf03..0000000 --- a/extras/html/style-business.css +++ /dev/null @@ -1,129 +0,0 @@ -@font-face { - font-family: 'text'; - src: url("./text.ttf") format("truetype"); -} - -@font-face { - font-family: 'heading'; - src: url("./heading.ttf") format("truetype"); -} - -@font-face { - font-family: 'code'; - src: url("./code.ttf") format("truetype"); -} - -@font-face { - font-family: 'handnotes'; - src: url("./handnotes.ttf") format("truetype"); -} - -@font-face { - font-family: 'typewriter'; - src: url("./typewriter.ttf") format("truetype"); -} - -body { - font-family: text, sans-serif; - background: linear-gradient(135deg, #f4f4f4, #e0e0e0); - color: #333; - max-width: 1024px; - padding: 20px; - margin: 20px auto; - border: 1px solid #ccc; - box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); - border-radius: 8px; -} - -h1, h2, h3 { - font-family: heading, serif; - color: #303c6c; - text-shadow: 0 0 2px rgba(0, 0, 0, 0.1); -} - -a { - text-decoration: none; - color: #1a73e8; - transition: color 0.3s, text-shadow 0.3s; -} - -a:hover { - text-decoration: underline; - color: #2a65ba; - text-shadow: 0 0 2px rgba(0, 0, 0, 0.1); -} - -a.textlink:before { - content: "⇒ "; - padding-left: 11px; -} - -.quote { - font-style: italic; - color: #2a65ba; - text-shadow: 0 0 2px rgba(0, 0, 0, 0.1); -} - -.quote:before { - content: "« "; - padding-left: 2px; -} - -.quote:after { - content: " »"; - padding-right: 2px; -} - -ul { - list-style: none; - padding-right: 23px; - padding-left: 10px; - margin: 0.75em 0 0.75em 0; -} - -li { - color: #303c6c; - margin-left: 1em; - margin-bottom: 0.25em; - text-shadow: 0 0 2px rgba(0, 0, 0, 0.1); -} - -li:before { - content: "★"; - padding-right: 5px; - color: #1a73e8; -} - -img { - max-width: 90%; - display: block; - margin: auto; - border: 2px solid #ccc; - box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); - border-radius: 5px; -} - -pre { - font-family: code, monospace; - overflow-x: auto; - background: #f0f0f0; - padding: 20px; - border-left: 4px solid #1a73e8; - border-radius: 5px; - box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1); - color: #333; -} - -span.inlinecode { - font-family: code, monospace; - background: #f0f0f0; - padding: 5px; - border: 1px solid #ccc; - border-radius: 5px; - box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1); - color: #333; -} - -.footer { - font-family: handnotes; -} diff --git a/extras/html/style-gemfeed-override.css b/extras/html/style-gemfeed-override.css deleted file mode 100644 index e69de29..0000000 diff --git a/extras/html/style-notes-override.css b/extras/html/style-notes-override.css deleted file mode 100644 index bc6159b..0000000 --- a/extras/html/style-notes-override.css +++ /dev/null @@ -1,3 +0,0 @@ -h1, h2, h3 { - font-family: handnotes, monospace; -} diff --git a/extras/html/style.css b/extras/html/style.css deleted file mode 100644 index 078bb62..0000000 --- a/extras/html/style.css +++ /dev/null @@ -1,129 +0,0 @@ -@font-face { - font-family: 'text'; - src: url("./text.ttf") format("truetype"); -} - -@font-face { - font-family: 'heading'; - src: url("./heading.ttf") format("truetype"); -} - -@font-face { - font-family: 'code'; - src: url("./code.ttf") format("truetype"); -} - -@font-face { - font-family: 'handnotes'; - src: url("./handnotes.ttf") format("truetype"); -} - -@font-face { - font-family: 'typewriter'; - src: url("./typewriter.ttf") format("truetype"); -} - -body { - font-family: text, sans-serif; - background: linear-gradient(135deg, #0d0d0d, #1f1f1f); - color: #e0e0e0; - max-width: 1024px; - padding: 20px; - margin: 20px auto; - border: 1px solid #333; - box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); - border-radius: 15px; -} - -h1, h2, h3 { - font-family: heading, serif; - color: #00ff9d; - text-shadow: 0 0 2px #00ff9d, 0 0 2px #00ff9d; -} - -a { - text-decoration: none; - color: #00ff9d; - transition: color 0.3s, text-shadow 0.3s; -} - -a:hover { - text-decoration: underline; - color: #00d4ff; - text-shadow: 0 0 10px #00d4ff, 0 0 20px #00d4ff; -} - -a.textlink:before { - content: "⇒ "; - padding-left: 11px; -} - -.quote { - font-style: italic; - color: #00d4ff; - text-shadow: 0 0 7px #00d4ff, 0 0 14px #00d4ff; -} - -.quote:before { - content: "« "; - padding-left: 2px; -} - -.quote:after { - content: " »"; - padding-right: 2px; -} - -ul { - list-style: none; - padding-right: 23px; - padding-left: 10px; - margin: 0.75em 0 0.75em 0; -} - -li { - color: #ff6347; - margin-left: 1em; - margin-bottom: 0.25em; - text-shadow: 0 0 5px #ff6347, 0 0 10px #ff6347; -} - -li:before { - content: "★"; - padding-right: 5px; - color: #00ff9d; -} - -img { - max-width: 90%; - display: block; - margin: auto; - border: 2px solid #00d4ff; - box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4); - border-radius: 10px; -} - -pre { - font-family: code, monospace; - overflow-x: auto; - background: #1e1e1e; - padding: 20px; - border-left: 4px solid #00ff9d; - border-radius: 5px; - box-shadow: inset 0 0 10px #00ff9d; - color: #00d4ff; -} - -span.inlinecode { - font-family: code, monospace; - background: #1e1e1e; - padding: 1px; - border: 1px solid #00d4ff; - border-radius: 3px; - box-shadow: 0 0 6px #00d4ff; - color: #00d4ff; -} - -.footer { - font-family: handnotes; -} diff --git a/extras/html/themes/business.conf b/extras/html/themes/business.conf deleted file mode 100644 index ea013b4..0000000 --- a/extras/html/themes/business.conf +++ /dev/null @@ -1,8 +0,0 @@ -declare -xr HTML_HEADER=./extras/html/header.html.part -declare -xr HTML_FOOTER=./extras/html/footer.html.part -declare -xr HTML_CSS_STYLE=./extras/html/style-business.css -declare -xr HTML_WEBFONT_TEXT=./extras/html/fonts/Lato/Lato-Regular.ttf -declare -xr HTML_WEBFONT_HEADING=./extras/html/fonts/Abril_Fatface/AbrilFatface-Regular.ttf -declare -xr HTML_WEBFONT_CODE=./extras/html/fonts/hack/Hack-Regular.ttf -declare -xr HTML_WEBFONT_HANDNOTES=./extras/html/fonts/khand/khand.ttf -declare -xr HTML_WEBFONT_TYPEWRITER=./extras/html/fonts/zai-aeg-mignon-typewriter-1924/zai_AEGMignonTypewriter1924.ttf diff --git a/extras/html/themes/business/style-gemfeed-override.css b/extras/html/themes/business/style-gemfeed-override.css new file mode 100644 index 0000000..e69de29 diff --git a/extras/html/themes/business/style-notes-override.css b/extras/html/themes/business/style-notes-override.css new file mode 100644 index 0000000..bc6159b --- /dev/null +++ b/extras/html/themes/business/style-notes-override.css @@ -0,0 +1,3 @@ +h1, h2, h3 { + font-family: handnotes, monospace; +} diff --git a/extras/html/themes/business/style.css b/extras/html/themes/business/style.css new file mode 100644 index 0000000..3fbbf03 --- /dev/null +++ b/extras/html/themes/business/style.css @@ -0,0 +1,129 @@ +@font-face { + font-family: 'text'; + src: url("./text.ttf") format("truetype"); +} + +@font-face { + font-family: 'heading'; + src: url("./heading.ttf") format("truetype"); +} + +@font-face { + font-family: 'code'; + src: url("./code.ttf") format("truetype"); +} + +@font-face { + font-family: 'handnotes'; + src: url("./handnotes.ttf") format("truetype"); +} + +@font-face { + font-family: 'typewriter'; + src: url("./typewriter.ttf") format("truetype"); +} + +body { + font-family: text, sans-serif; + background: linear-gradient(135deg, #f4f4f4, #e0e0e0); + color: #333; + max-width: 1024px; + padding: 20px; + margin: 20px auto; + border: 1px solid #ccc; + box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); + border-radius: 8px; +} + +h1, h2, h3 { + font-family: heading, serif; + color: #303c6c; + text-shadow: 0 0 2px rgba(0, 0, 0, 0.1); +} + +a { + text-decoration: none; + color: #1a73e8; + transition: color 0.3s, text-shadow 0.3s; +} + +a:hover { + text-decoration: underline; + color: #2a65ba; + text-shadow: 0 0 2px rgba(0, 0, 0, 0.1); +} + +a.textlink:before { + content: "⇒ "; + padding-left: 11px; +} + +.quote { + font-style: italic; + color: #2a65ba; + text-shadow: 0 0 2px rgba(0, 0, 0, 0.1); +} + +.quote:before { + content: "« "; + padding-left: 2px; +} + +.quote:after { + content: " »"; + padding-right: 2px; +} + +ul { + list-style: none; + padding-right: 23px; + padding-left: 10px; + margin: 0.75em 0 0.75em 0; +} + +li { + color: #303c6c; + margin-left: 1em; + margin-bottom: 0.25em; + text-shadow: 0 0 2px rgba(0, 0, 0, 0.1); +} + +li:before { + content: "★"; + padding-right: 5px; + color: #1a73e8; +} + +img { + max-width: 90%; + display: block; + margin: auto; + border: 2px solid #ccc; + box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); + border-radius: 5px; +} + +pre { + font-family: code, monospace; + overflow-x: auto; + background: #f0f0f0; + padding: 20px; + border-left: 4px solid #1a73e8; + border-radius: 5px; + box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1); + color: #333; +} + +span.inlinecode { + font-family: code, monospace; + background: #f0f0f0; + padding: 5px; + border: 1px solid #ccc; + border-radius: 5px; + box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1); + color: #333; +} + +.footer { + font-family: handnotes; +} diff --git a/extras/html/themes/business/theme.conf b/extras/html/themes/business/theme.conf new file mode 100644 index 0000000..6aea92f --- /dev/null +++ b/extras/html/themes/business/theme.conf @@ -0,0 +1,8 @@ +declare -xr HTML_HEADER=./extras/html/header.html.part +declare -xr HTML_FOOTER=./extras/html/footer.html.part +declare -xr HTML_CSS_STYLE=$HTML_THEME_DIR/style.css +declare -xr HTML_WEBFONT_TEXT=./extras/html/fonts/Lato/Lato-Regular.ttf +declare -xr HTML_WEBFONT_HEADING=./extras/html/fonts/Abril_Fatface/AbrilFatface-Regular.ttf +declare -xr HTML_WEBFONT_CODE=./extras/html/fonts/hack/Hack-Regular.ttf +declare -xr HTML_WEBFONT_HANDNOTES=./extras/html/fonts/khand/khand.ttf +declare -xr HTML_WEBFONT_TYPEWRITER=./extras/html/fonts/zai-aeg-mignon-typewriter-1924/zai_AEGMignonTypewriter1924.ttf diff --git a/extras/html/themes/future.conf b/extras/html/themes/future.conf deleted file mode 100644 index 0e6c953..0000000 --- a/extras/html/themes/future.conf +++ /dev/null @@ -1,9 +0,0 @@ -declare -xr HTML_HEADER=./extras/html/header.html.part -declare -xr HTML_FOOTER=./extras/html/footer.html.part -declare -xr HTML_CSS_STYLE=./extras/html/style.css -declare -xr HTML_WEBFONT_TEXT=./extras/html/fonts/Lato/Lato-Regular.ttf -declare -xr HTML_WEBFONT_HEADING=./extras/html/fonts/Abril_Fatface/AbrilFatface-Regular.ttf -declare -xr HTML_WEBFONT_CODE=./extras/html/fonts/hack/Hack-Regular.ttf -declare -xr HTML_WEBFONT_HANDNOTES=./extras/html/fonts/khand/khand.ttf -declare -xr HTML_WEBFONT_TYPEWRITER=./extras/html/fonts/zai-aeg-mignon-typewriter-1924/zai_AEGMignonTypewriter1924.ttf -declare -xr SOURCE_HIGHLIGHT_CSS=./extras/html/source-highlight-styles/sh_vampire.css diff --git a/extras/html/themes/future/style-gemfeed-override.css b/extras/html/themes/future/style-gemfeed-override.css new file mode 100644 index 0000000..e69de29 diff --git a/extras/html/themes/future/style-notes-override.css b/extras/html/themes/future/style-notes-override.css new file mode 100644 index 0000000..bc6159b --- /dev/null +++ b/extras/html/themes/future/style-notes-override.css @@ -0,0 +1,3 @@ +h1, h2, h3 { + font-family: handnotes, monospace; +} diff --git a/extras/html/themes/future/style.css b/extras/html/themes/future/style.css new file mode 100644 index 0000000..078bb62 --- /dev/null +++ b/extras/html/themes/future/style.css @@ -0,0 +1,129 @@ +@font-face { + font-family: 'text'; + src: url("./text.ttf") format("truetype"); +} + +@font-face { + font-family: 'heading'; + src: url("./heading.ttf") format("truetype"); +} + +@font-face { + font-family: 'code'; + src: url("./code.ttf") format("truetype"); +} + +@font-face { + font-family: 'handnotes'; + src: url("./handnotes.ttf") format("truetype"); +} + +@font-face { + font-family: 'typewriter'; + src: url("./typewriter.ttf") format("truetype"); +} + +body { + font-family: text, sans-serif; + background: linear-gradient(135deg, #0d0d0d, #1f1f1f); + color: #e0e0e0; + max-width: 1024px; + padding: 20px; + margin: 20px auto; + border: 1px solid #333; + box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); + border-radius: 15px; +} + +h1, h2, h3 { + font-family: heading, serif; + color: #00ff9d; + text-shadow: 0 0 2px #00ff9d, 0 0 2px #00ff9d; +} + +a { + text-decoration: none; + color: #00ff9d; + transition: color 0.3s, text-shadow 0.3s; +} + +a:hover { + text-decoration: underline; + color: #00d4ff; + text-shadow: 0 0 10px #00d4ff, 0 0 20px #00d4ff; +} + +a.textlink:before { + content: "⇒ "; + padding-left: 11px; +} + +.quote { + font-style: italic; + color: #00d4ff; + text-shadow: 0 0 7px #00d4ff, 0 0 14px #00d4ff; +} + +.quote:before { + content: "« "; + padding-left: 2px; +} + +.quote:after { + content: " »"; + padding-right: 2px; +} + +ul { + list-style: none; + padding-right: 23px; + padding-left: 10px; + margin: 0.75em 0 0.75em 0; +} + +li { + color: #ff6347; + margin-left: 1em; + margin-bottom: 0.25em; + text-shadow: 0 0 5px #ff6347, 0 0 10px #ff6347; +} + +li:before { + content: "★"; + padding-right: 5px; + color: #00ff9d; +} + +img { + max-width: 90%; + display: block; + margin: auto; + border: 2px solid #00d4ff; + box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4); + border-radius: 10px; +} + +pre { + font-family: code, monospace; + overflow-x: auto; + background: #1e1e1e; + padding: 20px; + border-left: 4px solid #00ff9d; + border-radius: 5px; + box-shadow: inset 0 0 10px #00ff9d; + color: #00d4ff; +} + +span.inlinecode { + font-family: code, monospace; + background: #1e1e1e; + padding: 1px; + border: 1px solid #00d4ff; + border-radius: 3px; + box-shadow: 0 0 6px #00d4ff; + color: #00d4ff; +} + +.footer { + font-family: handnotes; +} diff --git a/extras/html/themes/future/theme.conf b/extras/html/themes/future/theme.conf new file mode 100644 index 0000000..8e6f6e7 --- /dev/null +++ b/extras/html/themes/future/theme.conf @@ -0,0 +1,9 @@ +declare -xr HTML_HEADER=./extras/html/header.html.part +declare -xr HTML_FOOTER=./extras/html/footer.html.part +declare -xr HTML_CSS_STYLE=$HTML_THEME_DIR/style.css +declare -xr HTML_WEBFONT_TEXT=./extras/html/fonts/Lato/Lato-Regular.ttf +declare -xr HTML_WEBFONT_HEADING=./extras/html/fonts/Abril_Fatface/AbrilFatface-Regular.ttf +declare -xr HTML_WEBFONT_CODE=./extras/html/fonts/hack/Hack-Regular.ttf +declare -xr HTML_WEBFONT_HANDNOTES=./extras/html/fonts/khand/khand.ttf +declare -xr HTML_WEBFONT_TYPEWRITER=./extras/html/fonts/zai-aeg-mignon-typewriter-1924/zai_AEGMignonTypewriter1924.ttf +declare -xr SOURCE_HIGHLIGHT_CSS=./extras/html/source-highlight-styles/sh_vampire.css diff --git a/extras/html/themes/minimal/style.css b/extras/html/themes/minimal/style.css new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/extras/html/themes/minimal/style.css @@ -0,0 +1 @@ + diff --git a/extras/html/themes/minimal/theme.conf b/extras/html/themes/minimal/theme.conf new file mode 100644 index 0000000..abb446f --- /dev/null +++ b/extras/html/themes/minimal/theme.conf @@ -0,0 +1,4 @@ +declare -xr HTML_HEADER=./extras/html/header.html.part +declare -xr HTML_FOOTER=./extras/html/footer.html.part +declare -xr HTML_CSS_STYLE=./extras/html/themes/minimal/style.css +declare -xr SOURCE_HIGHLIGHT_CSS=./extras/html/source-highlight-styles/sh_vampire.css diff --git a/gemtexter b/gemtexter index 53a1335..2690f39 100755 --- a/gemtexter +++ b/gemtexter @@ -41,8 +41,8 @@ else source ./gemtexter.conf fi -if [ -f "$HTML_THEME_CONFIG" ]; then - source "$HTML_THEME_CONFIG" +if [ -f "$HTML_THEME_DIR/theme.conf" ]; then + source "$HTML_THEME_DIR/theme.conf" fi source ./lib/assert.source.sh @@ -59,15 +59,17 @@ source ./lib/template.source.sh help () { cat <\\1|g" } -html::add_extras () { +html::theme () { local -r html_base_dir="$CONTENT_BASE_DIR/html" - cp "$HTML_CSS_STYLE" "$html_base_dir/" + log INFO "Installing theme $HTML_THEME_DIR" + + html::theme::styles "$html_base_dir" + html::theme::webfonts "$html_base_dir" +} +html::theme::styles () { + local -r html_base_dir="$1"; shift + log INFO 'Installing theme CSS files' + + cp "$HTML_CSS_STYLE" "$html_base_dir/" while read -r section_dir; do - local override_source="./extras/html/style-$(basename "$section_dir")-override.css" + local override_source="$HTML_THEME_DIR/style-$(basename "$section_dir")-override.css" local override_dest="$section_dir/style-override.css" if [ ! -f "$override_source" ]; then touch "$override_dest" # Empty override @@ -84,6 +93,13 @@ html::add_extras () { cp "$override_source" "$override_dest" fi done < <(find "$html_base_dir" -mindepth 1 -maxdepth 1 -type d | $GREP -E -v '(\.git)') +} + +html::theme::webfonts () { + local -r html_base_dir="$1"; shift + log INFO 'Installing theme webfonts' + + set +u if [ -f "$HTML_WEBFONT_TEXT" ]; then cp "$HTML_WEBFONT_TEXT" "$html_base_dir/text.ttf" @@ -106,6 +122,8 @@ html::add_extras () { if [ -f "$HTML_WEBFONT_TYPEWRITER" ]; then cp "$HTML_WEBFONT_TYPEWRITER" "$html_base_dir/typewriter.ttf" fi + + set -u } html::source_highlight () { @@ -117,11 +135,11 @@ html::source_highlight () { html::encode "$bare_text" echo '' else - local style_css + local style_css='' if [ -n "$SOURCE_HIGHLIGHT_CSS" ]; then style_css="--style-css-file=$SOURCE_HIGHLIGHT_CSS" fi - $SOURCE_HIGHLIGHT --src-lang="$language" "$style_css" <<< "$bare_text" | + $SOURCE_HIGHLIGHT --src-lang="$language" $style_css <<< "$bare_text" | $SED 's|||; s|||;' fi } -- cgit v1.2.3