From 491d7d061ec029c9fdb0ffa9fbdf67164460a3ca Mon Sep 17 00:00:00 2001 From: Heitor Pascoal de Bittencourt Date: Thu, 4 May 2023 12:57:57 -0300 Subject: [PATCH 01/18] Automatically set link to RSS or ATOM feed Set the type to either `application/rss+xml` or `application/atom+xml` according to the `feed_filename` from `config.toml`. --- templates/index.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/templates/index.html b/templates/index.html index 42366b5..1ee2a77 100644 --- a/templates/index.html +++ b/templates/index.html @@ -12,7 +12,12 @@ {{ head_macros::head(config=config) }} {%- if config.generate_feed %} - + {%- if "rss" in config.feed_filename %} + {% set feed_type = 'rss+xml' %} + {%- else %} + {% set feed_type = 'atom+xml' %} + {% endif -%} + {% endif -%} {%- if config.extra.favicon %} From c365a2373e71cab38c3a47e1bb1e6365d61cb135 Mon Sep 17 00:00:00 2001 From: lynn pepin Date: Fri, 16 Jun 2023 14:21:29 -0400 Subject: [PATCH 02/18] feat: Added a light version and an automatic (light/dark) version for each theme --- config.toml | 11 ++++++----- sass/color/background_auto.scss | 14 ++++++++++++++ sass/color/background_light.scss | 3 +++ sass/color/blue-auto.scss | 29 +++++++++++++++++++++++++++++ sass/color/blue-light.scss | 12 ++++++++++++ sass/color/green-auto.scss | 29 +++++++++++++++++++++++++++++ sass/color/green-light.scss | 12 ++++++++++++ sass/color/orange-auto.scss | 29 +++++++++++++++++++++++++++++ sass/color/orange-light.scss | 12 ++++++++++++ sass/color/pink-auto.scss | 29 +++++++++++++++++++++++++++++ sass/color/pink-light.scss | 12 ++++++++++++ sass/color/red-auto.scss | 29 +++++++++++++++++++++++++++++ sass/color/red-light.scss | 12 ++++++++++++ 13 files changed, 228 insertions(+), 5 deletions(-) create mode 100644 sass/color/background_auto.scss create mode 100644 sass/color/background_light.scss create mode 100644 sass/color/blue-auto.scss create mode 100644 sass/color/blue-light.scss create mode 100644 sass/color/green-auto.scss create mode 100644 sass/color/green-light.scss create mode 100644 sass/color/orange-auto.scss create mode 100644 sass/color/orange-light.scss create mode 100644 sass/color/pink-auto.scss create mode 100644 sass/color/pink-light.scss create mode 100644 sass/color/red-auto.scss create mode 100644 sass/color/red-light.scss diff --git a/config.toml b/config.toml index 7af0f3d..2898659 100644 --- a/config.toml +++ b/config.toml @@ -19,13 +19,14 @@ highlight_theme = "boron" # One of: blue, green, orange, pink, red. # Defaults to blue. -accent_color = "blue" +# Append -light for light themes, e.g. blue-light +# Or append -auto, e.g. blue-auto +accent_color = "blue-auto" -# One of: blue, dark, green, orange, pink, red. -# Enabling dark background will also modify primary font color -# to be darker. +# One of: blue, dark, green, orange, pink, red, light, auto +# Enabling dark background will also modify primary font color to be darker. # Defaults to accent color (or, if not accent color specified, to blue). -background_color = "blue" +background_color = "auto" # The logo text - defaults to "Terminimal theme" logo_text = "Terminimal theme" diff --git a/sass/color/background_auto.scss b/sass/color/background_auto.scss new file mode 100644 index 0000000..e1cab79 --- /dev/null +++ b/sass/color/background_auto.scss @@ -0,0 +1,14 @@ +:root { + + @media (prefers-color-scheme: light) { + --background: white; + + --color: #101010; + } + + @media (prefers-color-scheme: dark) { + --background: #101010; + + --color: #A9B7C6; + } +} diff --git a/sass/color/background_light.scss b/sass/color/background_light.scss new file mode 100644 index 0000000..ac41318 --- /dev/null +++ b/sass/color/background_light.scss @@ -0,0 +1,3 @@ +:root { + --background: #f0f0f0; +} diff --git a/sass/color/blue-auto.scss b/sass/color/blue-auto.scss new file mode 100644 index 0000000..bf20e33 --- /dev/null +++ b/sass/color/blue-auto.scss @@ -0,0 +1,29 @@ +:root { + @media (prefers-color-scheme: dark) { + --accent: rgb(35,176,255); + --accent-alpha-70: rgba(35,176,255,.7); + --accent-alpha-20: rgba(35,176,255,.2); + + --background: #101010; + --color: #f0f0f0; + --border-color: rgba(255,240,224,.125); + + div.logo { + color: black; + } + + } + @media (prefers-color-scheme: light) { + --accent: rgb(32,128,192); + --accent-alpha-70: rgba(32,128,192,.7); + --accent-alpha-20: rgba(32,128,192,.2); + + --background: white; + --color: #201030; + --border-color: rgba(0,0,16,.125); + + div.logo { + color: white; + } + } +} diff --git a/sass/color/blue-light.scss b/sass/color/blue-light.scss new file mode 100644 index 0000000..c41d839 --- /dev/null +++ b/sass/color/blue-light.scss @@ -0,0 +1,12 @@ +:root { + --accent: rgb(32,128,192); + --accent-alpha-70: rgba(32,128,192,.7); + --accent-alpha-20: rgba(32,128,192,.2); + + --background: white; + --color: #1D212C; + --border-color: rgba(0, 0, 0, .1); + div.logo { + color: white; + } +} diff --git a/sass/color/green-auto.scss b/sass/color/green-auto.scss new file mode 100644 index 0000000..eabfae6 --- /dev/null +++ b/sass/color/green-auto.scss @@ -0,0 +1,29 @@ +:root { + @media (prefers-color-scheme: dark) { + --accent: rgb(120,226,160); + --accent-alpha-70: rgba(120,226,160,.7); + --accent-alpha-20: rgba(120,226,160,.2); + + --background: #101010; + --color: #f0f0f0; + --border-color: rgba(255,240,224,.125); + + div.logo { + color: black; + } + + } + @media (prefers-color-scheme: light) { + --accent: rgb(24, 192, 128); + --accent-alpha-70: rgba(24, 192, 128,.7); + --accent-alpha-20: rgba(24, 192, 128,.2); + + --background: white; + --color: #201030; + --border-color: rgba(0,0,16,.125) + + div.logo { + color: white; + } + } +} diff --git a/sass/color/green-light.scss b/sass/color/green-light.scss new file mode 100644 index 0000000..9ee64f3 --- /dev/null +++ b/sass/color/green-light.scss @@ -0,0 +1,12 @@ +:root { + --accent: rgb(24, 192, 128); + --accent-alpha-70: rgba(24, 192, 128,.7); + --accent-alpha-20: rgba(24, 192, 128,.2); + + --background: white; + --color: #1D212C; + --border-color: rgba(0, 0, 0, .1); + div.logo { + color: white; + } +} diff --git a/sass/color/orange-auto.scss b/sass/color/orange-auto.scss new file mode 100644 index 0000000..3c19ce4 --- /dev/null +++ b/sass/color/orange-auto.scss @@ -0,0 +1,29 @@ +:root { + @media (prefers-color-scheme: dark) { + --accent: rgb(255,168,106); + --accent-alpha-70: rgba(255,168,106,.7); + --accent-alpha-20: rgba(255,168,106,.2); + + --background: #101010; + --color: #f0f0f0; + --border-color: rgba(255,240,224,.125); + + div.logo { + color: black; + } + + } + @media (prefers-color-scheme: light) { + --accent: rgb(240,128,48); + --accent-alpha-70: rgba(240,128,48,.7); + --accent-alpha-20: rgba(240,128,48,.2); + + --background: white; + --color: #201030; + --border-color: rgba(0,0,16,.125); + + div.logo { + color: white; + } + } +} diff --git a/sass/color/orange-light.scss b/sass/color/orange-light.scss new file mode 100644 index 0000000..6f7b8f9 --- /dev/null +++ b/sass/color/orange-light.scss @@ -0,0 +1,12 @@ +:root { + --accent: rgb(240,128,48); + --accent-alpha-70: rgba(240,128,48,.7); + --accent-alpha-20: rgba(240,128,48,.2); + + --background: white; + --color: #1D212C; + --border-color: rgba(0, 0, 0, .1); + div.logo { + color: white; + } +} \ No newline at end of file diff --git a/sass/color/pink-auto.scss b/sass/color/pink-auto.scss new file mode 100644 index 0000000..705c706 --- /dev/null +++ b/sass/color/pink-auto.scss @@ -0,0 +1,29 @@ +:root { + @media (prefers-color-scheme: dark) { + --accent: rgb(224,64,192); + --accent-alpha-70: rgba(224,64,192); + --accent-alpha-20: rgba(224,64,192,.2); + + --background: #101010; + --color: #f0f0f0; + --border-color: rgba(255,240,224,.125); + + div.logo { + color: black; + } + + } + @media (prefers-color-scheme: light) { + --accent: rgb(238,114,241); + --accent-alpha-70: rgba(238,114,241,.7); + --accent-alpha-20: rgba(238,114,241,.2); + + --background: white; + --color: #201030; + --border-color: rgba(0,0,16,.125); + + div.logo { + color: white; + } + } +} diff --git a/sass/color/pink-light.scss b/sass/color/pink-light.scss new file mode 100644 index 0000000..aa8437c --- /dev/null +++ b/sass/color/pink-light.scss @@ -0,0 +1,12 @@ +:root { + --accent: rgb(224,64,192); + --accent-alpha-70: rgba(224,64,192); + --accent-alpha-20: rgba(224,64,192,.2); + + --background: white; + --color: #1D212C; + --border-color: rgba(0, 0, 0, .1); + div.logo { + color: white; + } +} diff --git a/sass/color/red-auto.scss b/sass/color/red-auto.scss new file mode 100644 index 0000000..a0016f2 --- /dev/null +++ b/sass/color/red-auto.scss @@ -0,0 +1,29 @@ +:root { + @media (prefers-color-scheme: dark) { + --accent: rgb(255,98,102); + --accent-alpha-70: rgba(255,98,102,.7); + --accent-alpha-20: rgba(255,98,102,.2); + + --background: #101010; + --color: #f0f0f0; + --border-color: rgba(255,240,224,.125); + + div.logo { + color: black; + } + + } + @media (prefers-color-scheme: light) { + --accent: rgb(240,48,64); + --accent-alpha-70: rgba(240,48,64,.7); + --accent-alpha-20: rgba(240,48,64,.2); + + --background: white; + --color: #201030; + --border-color: rgba(0,0,16,.125); + + div.logo { + color: white; + } + } +} diff --git a/sass/color/red-light.scss b/sass/color/red-light.scss new file mode 100644 index 0000000..d2f0e4c --- /dev/null +++ b/sass/color/red-light.scss @@ -0,0 +1,12 @@ +:root { + --accent: rgb(240,48,64); + --accent-alpha-70: rgba(240,48,64,.7); + --accent-alpha-20: rgba(240,48,64,.2); + + --background: white; + --color: #1D212C; + --border-color: rgba(0, 0, 0, .1); + div.logo { + color: white; + } +} From a5e119ec7ba92c01502c9fbd8036550f1f2f4552 Mon Sep 17 00:00:00 2001 From: Heitor Pascoal de Bittencourt Date: Thu, 22 Jun 2023 13:10:37 -0300 Subject: [PATCH 03/18] Add note about the feeds in the theme's config.toml --- config.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config.toml b/config.toml index 7af0f3d..2a5b87d 100644 --- a/config.toml +++ b/config.toml @@ -5,6 +5,12 @@ title = "Zola Terminimal theme" # Sass compilation is required compile_sass = true +# The theme supports feeds (RSS and ATOM) +generate_feed = true + +# Use `rss.xml` for RSS feeds and `atom.xml` for ATOM. +feed_filename = "atom.xml" + # Optional: enable tags taxonomies = [ {name = "tags"} From 4f96dd4da5c0b9977c560049579c62c7e1f61e6a Mon Sep 17 00:00:00 2001 From: lynn pepin Date: Thu, 22 Jun 2023 17:29:54 -0400 Subject: [PATCH 04/18] fix: Fix default color in config.toml and examples --- README.md | 11 ++++++----- config.toml | 4 ++-- theme.toml | 8 +++++--- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 1ce882c..e310694 100644 --- a/README.md +++ b/README.md @@ -149,13 +149,14 @@ of your `config.toml`: [extra] # One of: blue, green, orange, pink, red. -# Defaults to blue. +# Defaults to blue. +# Append -light for light themes, e.g. blue-light +# Or append -auto, e.g. blue-auto accent_color = "green" -# One of: blue, dark, green, orange, pink, red. -# Enabling dark background will also modify primary font color -# to be darker. -# Defaults to accent color (or, if not accent color specified, to blue). +# One of: blue, dark, green, orange, pink, red, light, auto +# Enabling dark background will also modify primary font color to be darker. +# Defaults to accent color (or, if not accent color specified, to blue). background_color = "dark" ``` diff --git a/config.toml b/config.toml index 2898659..5c07261 100644 --- a/config.toml +++ b/config.toml @@ -21,12 +21,12 @@ highlight_theme = "boron" # Defaults to blue. # Append -light for light themes, e.g. blue-light # Or append -auto, e.g. blue-auto -accent_color = "blue-auto" +accent_color = "blue" # One of: blue, dark, green, orange, pink, red, light, auto # Enabling dark background will also modify primary font color to be darker. # Defaults to accent color (or, if not accent color specified, to blue). -background_color = "auto" +background_color = "blue" # The logo text - defaults to "Terminimal theme" logo_text = "Terminimal theme" diff --git a/theme.toml b/theme.toml index 5bcbdb0..5dbccf7 100644 --- a/theme.toml +++ b/theme.toml @@ -20,11 +20,13 @@ repo = "https://github.com/panr/hugo-theme-terminal" [extra] # One of: blue, green, orange, pink, red. +# Defaults to blue. +# Append -light for light themes, e.g. blue-light +# Or append -auto, e.g. blue-auto accent_color = "blue" -# One of: blue, dark, green, orange, pink, red. -# Enabling dark background will also modify primary font color -# to be darker. +# One of: blue, dark, green, orange, pink, red, light, auto +# Enabling dark background will also modify primary font color to be darker. # Defaults to accent color (or, if not accent color specified, to blue). background_color = "blue" From 2b55b768ac6802f29a54b3878fae953b41ef816f Mon Sep 17 00:00:00 2001 From: lynn pepin Date: Thu, 22 Jun 2023 17:31:43 -0400 Subject: [PATCH 05/18] fix: Missing semicolon in border color for green-auto.scss --- sass/color/green-auto.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sass/color/green-auto.scss b/sass/color/green-auto.scss index eabfae6..2eb5e12 100644 --- a/sass/color/green-auto.scss +++ b/sass/color/green-auto.scss @@ -20,7 +20,7 @@ --background: white; --color: #201030; - --border-color: rgba(0,0,16,.125) + --border-color: rgba(0,0,16,.125); div.logo { color: white; From a9969735db98ec286063c5772e53ad6411997c6b Mon Sep 17 00:00:00 2001 From: Heitor Pascoal de Bittencourt Date: Mon, 31 Jul 2023 13:27:33 -0300 Subject: [PATCH 06/18] Allow markdown in caption of figures --- templates/shortcodes/figure.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/shortcodes/figure.html b/templates/shortcodes/figure.html index b9de271..e014068 100644 --- a/templates/shortcodes/figure.html +++ b/templates/shortcodes/figure.html @@ -2,7 +2,7 @@
{% if caption %} -
{{ caption }}
+
{{ caption | markdown() | safe }}
{% endif %}
{% endif %} From 4ce06e1894a3fea96b689e03bef5fa4098a05f46 Mon Sep 17 00:00:00 2001 From: Antonios Barotsis Date: Wed, 2 Aug 2023 21:49:04 +0300 Subject: [PATCH 07/18] Added the option to only show the description Co-authored-by: Antonios Barotsis Co-authored-by: Bkeinn <60117033+Bkeinn@users.noreply.github.com> --- templates/index.html | 3 ++- templates/macros/post.html | 8 ++++++-- templates/page.html | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/templates/index.html b/templates/index.html index 86cb0cd..280971e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -71,7 +71,8 @@ {%- for page in show_pages %}
{{ post_macros::header(page=page) }} - {{ post_macros::content(page=page, summary=true) }} + + {{ post_macros::content(page=page, summary=true, show_only_description=page.extra.show_only_description | default(value=false)) }}
{% endfor -%} {% else %} + {#- full content -#}
{{ page.content | safe }}
diff --git a/templates/page.html b/templates/page.html index fea56bb..9dea4cc 100644 --- a/templates/page.html +++ b/templates/page.html @@ -7,7 +7,7 @@ {% block content %}
{{ post_macros::header(page=page) }} - {{ post_macros::content(page=page, summary=true, show_only_description=false) }} + {{ post_macros::content(page=page, summary=false, show_only_description=false) }} {{ post_macros::earlier_later(page=page) }}
{% endblock content %} From d22b1e5a9e4f9338aad21bd05e5b7fb7c7d1a1dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Romanowski?= Date: Mon, 18 Dec 2023 21:26:15 +0100 Subject: [PATCH 13/18] Mention Markdown support in figure captions --- README.md | 6 +++--- content/welcome-terminimal-theme.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index cef9347..586b50c 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ Example: Same as `image`, but with a few extra optional arguments: -- **`caption`** +- **`caption`** (supports markdown) - **`caption_position`** (center \[default\] | left | right) - **`caption_style`** @@ -97,8 +97,8 @@ Example: style="width: 25%;", position="right", caption_position="left", - caption="Ferris, the (unofficial) Rust mascot", - caption_style="font-weight: bold; font-style: italic;") }} + caption="**Ferris**, the (unofficial) Rust mascot", + caption_style="font-style: italic;") }} ``` ## OpenGraph diff --git a/content/welcome-terminimal-theme.md b/content/welcome-terminimal-theme.md index 32a356e..d7bda16 100644 --- a/content/welcome-terminimal-theme.md +++ b/content/welcome-terminimal-theme.md @@ -77,7 +77,7 @@ figure(src="http://rustacean.net/assets/rustacean-flat-gesture.png", style="width: 25%;", position="center", caption_position="left", - caption="Ferris, the (unofficial) Rust mascot", + caption="**Ferris**, the (unofficial) Rust mascot", caption_style="font-weight: bold; font-style: italic;") ``` @@ -85,8 +85,8 @@ figure(src="http://rustacean.net/assets/rustacean-flat-gesture.png", style="width: 25%;", position="center", caption_position="left", - caption="Ferris, the (unofficial) Rust mascot", - caption_style="font-weight: bold; font-style: italic;") }} + caption="**Ferris**, the (unofficial) Rust mascot", + caption_style="font-style: italic;") }} --- From bef4cc90204025ba411d31dc591338d0c9760dd3 Mon Sep 17 00:00:00 2001 From: Heitor Pascoal de Bittencourt Date: Tue, 6 Feb 2024 15:31:27 -0300 Subject: [PATCH 14/18] shortcodes: use async and lazy for images. Zola v0.18 added an option to set all images with `decoding=async` and `load=lazy`, but this only applies to `` tags generated from Markdown `![]()` syntax. This patch adds these attributes by default to `figure` and `image` macros. --- templates/shortcodes/figure.html | 2 +- templates/shortcodes/image.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/shortcodes/figure.html b/templates/shortcodes/figure.html index e014068..d841b5c 100644 --- a/templates/shortcodes/figure.html +++ b/templates/shortcodes/figure.html @@ -1,6 +1,6 @@ {% if src %}
- + {% if caption %}
{{ caption | markdown() | safe }}
{% endif %} diff --git a/templates/shortcodes/image.html b/templates/shortcodes/image.html index 091eeb8..7a2f044 100644 --- a/templates/shortcodes/image.html +++ b/templates/shortcodes/image.html @@ -4,5 +4,5 @@ {# ... then prepend the site's base URL to the image's URL. #} {% set src = config.base_url ~ src %} {% endif %} - + {% endif %} From 4be31aa151fe23d963e126466f3b001382a389d6 Mon Sep 17 00:00:00 2001 From: Heitor Pascoal de Bittencourt Date: Tue, 5 Mar 2024 09:29:16 -0300 Subject: [PATCH 15/18] tag page: add / to "all tags" link This is to improve Google indexing pages, for the /tags/ page. In GitHub Pages, the URL /tags does not exist per se, but is a redirect to /tags/. Google Crawler gets confused with 301 HTTP status and does not index it. --- templates/tags/single.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/tags/single.html b/templates/tags/single.html index 92183b6..19c899b 100644 --- a/templates/tags/single.html +++ b/templates/tags/single.html @@ -12,7 +12,7 @@ ({{ term.pages | length }} post{{ term.pages | length | pluralize }}) - + Show all tags From cf114ec7e2685b002d06f9198d205826f590ea65 Mon Sep 17 00:00:00 2001 From: Lucas Kent Date: Sat, 4 May 2024 12:20:58 +1000 Subject: [PATCH 16/18] Fix postview navigation --- templates/macros/post.html | 50 ++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/templates/macros/post.html b/templates/macros/post.html index c8627c9..5ea20d1 100644 --- a/templates/macros/post.html +++ b/templates/macros/post.html @@ -33,31 +33,33 @@ {% macro earlier_later(page) %} - {%- if config.extra.enable_post_view_navigation and page.lower or page.higher %} -