From 6b275f6d281b5d8653562dc9bb84b6d4681a1153 Mon Sep 17 00:00:00 2001 From: jakeg Date: Fri, 28 Apr 2023 19:41:47 +0000 Subject: Update 'theme.toml' Fix Link. --- theme.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/theme.toml b/theme.toml index ed137c8..f2475d6 100644 --- a/theme.toml +++ b/theme.toml @@ -1,7 +1,7 @@ name = "Bear" description = "Bear blog theme" license = "MIT" -homepage = "https://codeberg.org/alanpearce/zola/bearblog" +homepage = "https://codeberg.org/alanpearce/zola-bearblog" # The minimum version of Zola required min_version = "0.4.0" # An optional live demo URL -- cgit 1.4.1 From 1706ade7a4d2161072028aa37dc0af574853a56f Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 30 Jul 2023 06:31:27 +0000 Subject: Linkify demo URL --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5396a5b..bcf21e0 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ## Demo -For a current & working demo of this theme, please check out https://alanpearce.codeberg.page/zola-bearblog/ 🎯. +For a current & working demo of this theme, please check out 🎯. ## Screenshots -- cgit 1.4.1 From d69e95a01c254ed616b0c4e5a1f8bfdcec7b00fe Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 2 Sep 2023 10:38:26 +0200 Subject: Add content-security-policy header-equivalent meta tag --- templates/base.html | 1 + templates/security_tags.html | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 templates/security_tags.html diff --git a/templates/base.html b/templates/base.html index 4ba8442..02fdfe6 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,6 +1,7 @@ + {% include "security_tags.html" ignore missing %} {% include "favicon.html" ignore missing -%} diff --git a/templates/security_tags.html b/templates/security_tags.html new file mode 100644 index 0000000..721d511 --- /dev/null +++ b/templates/security_tags.html @@ -0,0 +1,2 @@ + + -- cgit 1.4.1 From a1bcb91851d84d3796a8a281af8d01ce0a79a3fc Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 2 Sep 2023 18:27:11 +0200 Subject: Add netlify.toml --- netlify.toml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 netlify.toml diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 0000000..112bf78 --- /dev/null +++ b/netlify.toml @@ -0,0 +1,15 @@ +[build] +publish = "public" +command = "zola build" + +[build.environment] +# Set the version name that you want to use and Netlify will automatically use it. +ZOLA_VERSION = "0.17.2" + +# The magic for deploying previews of branches. +# We need to override the base url with whatever url Netlify assigns to our +# preview site. We do this using the Netlify environment variable +# `$DEPLOY_PRIME_URL`. + +[context.deploy-preview] +command = "zola build --base-url $DEPLOY_PRIME_URL" -- cgit 1.4.1 From edfec31a52c4548100ba845dc16df4c046f59042 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 2 Sep 2023 18:39:05 +0200 Subject: Configure headers for netlify --- netlify.toml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/netlify.toml b/netlify.toml index 112bf78..422ca3b 100644 --- a/netlify.toml +++ b/netlify.toml @@ -13,3 +13,13 @@ ZOLA_VERSION = "0.17.2" [context.deploy-preview] command = "zola build --base-url $DEPLOY_PRIME_URL" + +[[headers]] + for = "/*" + [headers.values] + X-Frame-Options = "DENY" + X-Content-Type-Options = "nosniff" + X-XSS-Protection = "1; mode=block" + Referrer-Policy = "strict-origin-when-cross-origin" + Strict-Transport-Security = "max-age=63072000; includeSubdomains" + Content-Security-Policy = "default-src 'none'; img-src 'self'; object-src 'none'; script-src 'none'; style-src 'unsafe-inline'; frame-ancestors 'none'" -- cgit 1.4.1 From 34239851f861a84de4cc73d8e9a2027656e64c37 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 2 Sep 2023 18:39:12 +0200 Subject: Add netlify status badge to readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index bcf21e0..e1f2e99 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Zola ʕ•ᴥ•ʔ Bear Blog +[![Netlify Status](https://api.netlify.com/api/v1/badges/121b53ce-c913-4604-9179-eb3cca31cd2c/deploy-status)](https://app.netlify.com/sites/zola-bearblog/deploys) + 🧸 A [Zola](https://www.getzola.org/)-theme based on [Bear Blog](https://bearblog.dev). > Free, no-nonsense, super-fast blogging. -- cgit 1.4.1 From 53d198f0745df32ad0a2547e177c57cbdf96eb60 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 2 Sep 2023 18:41:12 +0200 Subject: Move demo site to netlify --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e1f2e99..2661641 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ ## Demo -For a current & working demo of this theme, please check out 🎯. +For a current & working demo of this theme, please check out 🎯. ## Screenshots -- cgit 1.4.1 From 241f290f697a1301c6173d41fb9c6b45ec203287 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 2 Sep 2023 18:51:39 +0200 Subject: Remove ignored CSP content --- templates/security_tags.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/security_tags.html b/templates/security_tags.html index 721d511..0f922ea 100644 --- a/templates/security_tags.html +++ b/templates/security_tags.html @@ -1,2 +1,2 @@ - + -- cgit 1.4.1 From 9a344d88944a08a96e9681fd399d9b2f25eac56c Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 2 Sep 2023 18:54:22 +0200 Subject: Add meta description --- config.toml | 2 +- templates/seo_tags.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config.toml b/config.toml index ca8d27a..9b94cd6 100644 --- a/config.toml +++ b/config.toml @@ -1,6 +1,6 @@ title = "Zola ʕ•ᴥ•ʔ Bear Blog" base_url = "https://alanpearce.codeberg.page/zola-bearblog" -description = "" +description = "A Zola-theme based on Bear Blog." # Whether to automatically compile all Sass files in the sass directory compile_sass = false diff --git a/templates/seo_tags.html b/templates/seo_tags.html index 797569a..4eb2bc8 100644 --- a/templates/seo_tags.html +++ b/templates/seo_tags.html @@ -1 +1,2 @@ + -- cgit 1.4.1 From 0800ba2afe4e733796c7c3a177ffbbf458f78eca Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 2 Sep 2023 18:55:59 +0200 Subject: Update demo URL --- theme.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/theme.toml b/theme.toml index f2475d6..1bba50d 100644 --- a/theme.toml +++ b/theme.toml @@ -5,7 +5,7 @@ homepage = "https://codeberg.org/alanpearce/zola-bearblog" # The minimum version of Zola required min_version = "0.4.0" # An optional live demo URL -demo = "https://alanpearce.codeberg.page/zola-bearblog" +demo = "https://zola-bearblog.netlify.app/" # Any variable there can be overridden in the end user `config.toml` # You don't need to prefix variables by the theme name but as this will -- cgit 1.4.1 From 099acbd690f8ae103cee08ed3e693ad7d7bc9ed6 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 2 Sep 2023 19:04:45 +0200 Subject: Add "deploy to netlify" button --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 2661641..9711ad7 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,12 @@ Then, adjust the `config.toml` as detailed below. For more information, read the official [setup guide][zola-setup-guide] of Zola. +Alternatively, you can quickly deploy a copy of the theme site to Netlify using this button: + +[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://gitlab.com/alanpearce/zola-bearblog) + +(Note that this method makes it harder to keep up-to-date with theme updates, which might be necessary for newer versions of Zola.) + ## Adjust configuration / config.toml Please check out the included [config.toml](https://codeberg.org/alanpearce/zola-bearblog/src/branch/main/config.toml) -- cgit 1.4.1 From eed984fb5d48cd39a9444bee5d49e733cc4ee093 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 3 Sep 2023 07:49:31 +0200 Subject: Merge dark/light screenshots into one --- README.md | 11 +++-------- screenshot-dark.png | Bin 319272 -> 0 bytes screenshot.png | Bin 317002 -> 262700 bytes 3 files changed, 3 insertions(+), 8 deletions(-) delete mode 100644 screenshot-dark.png diff --git a/README.md b/README.md index 9711ad7..db77233 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,9 @@ For a current & working demo of this theme, please check out 🎯. -## Screenshots +## Screenshot -⬜️ [Light][light-screenshot] -![light mode screenshot][light-screenshot] - -⬛️ [Dark][dark-screenshot] -![dark mode screenshot][dark-screenshot] +![Screenshot][screenshot] When the user's browser is running »dark mode«, the dark color scheme will be used automatically. The default is the light/white color scheme. Check out the [`style.html`](https://codeberg.org/alanpearce/zola-bearblog/src/branch/main/templates/style.html)-file for the implementation. @@ -84,5 +80,4 @@ A special thank you goes out to [Herman](https://herman.bearblog.dev), for creat [MIT License](http://en.wikipedia.org/wiki/MIT_License) © [Alan Pearce](https://www.alanpearce.eu/) [zola-setup-guide]: https://www.getzola.org/documentation/getting-started/installation/ -[light-screenshot]: https://codeberg.org/alanpearce/zola-bearblog/raw/branch/main/screenshot.png -[dark-screenshot]: https://codeberg.org/alanpearce/zola-bearblog/raw/branch/main/screenshot-dark.png +[screenshot]: https://codeberg.org/alanpearce/zola-bearblog/raw/branch/main/screenshot.png diff --git a/screenshot-dark.png b/screenshot-dark.png deleted file mode 100644 index 266f883..0000000 Binary files a/screenshot-dark.png and /dev/null differ diff --git a/screenshot.png b/screenshot.png index 4013a5c..273266a 100644 Binary files a/screenshot.png and b/screenshot.png differ -- cgit 1.4.1 From 4c9ac0a4636df958309fe7bb17945113a0fa5fb2 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2023 08:23:09 +0000 Subject: Update base_url --- config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.toml b/config.toml index 9b94cd6..d2a8833 100644 --- a/config.toml +++ b/config.toml @@ -1,5 +1,5 @@ title = "Zola ʕ•ᴥ•ʔ Bear Blog" -base_url = "https://alanpearce.codeberg.page/zola-bearblog" +base_url = "https://zola-bearblog.netlify.app/" description = "A Zola-theme based on Bear Blog." # Whether to automatically compile all Sass files in the sass directory -- cgit 1.4.1 From 093ac10f7e5c9bd40e9def573c654069e4cba1a9 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2023 18:19:29 +0200 Subject: Add form-action and base-uri CSPs --- netlify.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlify.toml b/netlify.toml index 422ca3b..b75399f 100644 --- a/netlify.toml +++ b/netlify.toml @@ -22,4 +22,4 @@ command = "zola build --base-url $DEPLOY_PRIME_URL" X-XSS-Protection = "1; mode=block" Referrer-Policy = "strict-origin-when-cross-origin" Strict-Transport-Security = "max-age=63072000; includeSubdomains" - Content-Security-Policy = "default-src 'none'; img-src 'self'; object-src 'none'; script-src 'none'; style-src 'unsafe-inline'; frame-ancestors 'none'" + Content-Security-Policy = "default-src 'none'; img-src 'self'; object-src 'none'; script-src 'none'; style-src 'unsafe-inline'; form-action 'none'; base-uri 'self'; frame-ancestors 'none'" -- cgit 1.4.1 From f51202d961e6d2337a96ef3552c4efced1fe2beb Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2023 19:10:40 +0200 Subject: Allow end-user to disable CSP header meta tags without editing theme --- config.toml | 1 + templates/base.html | 8 ++++++-- theme.toml | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config.toml b/config.toml index d2a8833..78e9f9a 100644 --- a/config.toml +++ b/config.toml @@ -20,6 +20,7 @@ highlight_code = true [extra] date_format="%d %b, %Y" +webserver_sends_csp_headers=true [[extra.main_menu]] name = "Bear" diff --git a/templates/base.html b/templates/base.html index 02fdfe6..ee206b3 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,7 +1,9 @@ - {% include "security_tags.html" ignore missing %} + {%- if config.webserver_sends_csp_headers %} + {%- include "security_tags.html" ignore missing %} + {%- endif %} {% include "favicon.html" ignore missing -%} @@ -13,7 +15,9 @@ {%- endblock -%} {%- endif %} - {% include "style.html" ignore missing -%} + {% include "custom_head.html" ignore missing -%} diff --git a/theme.toml b/theme.toml index 1bba50d..902c8ec 100644 --- a/theme.toml +++ b/theme.toml @@ -13,6 +13,7 @@ demo = "https://zola-bearblog.netlify.app/" # Use snake_casing to be consistent with the rest of Zola [extra] date_format="%d %b, %Y" +webserver_sends_csp_headers=false [author] name = "Alan Pearce" -- cgit 1.4.1 From d10630da50a2b0e005ef0499190cc5cc898f0b06 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2023 19:11:07 +0200 Subject: Hash inline style in CSP openssl dgst -sha256 -binary < templates/style.html | openssl enc -base64 2Sbht7dvdhJX00j84akXy9AejYUf6sOM3OpwMxNiDXQ= --- netlify.toml | 2 +- templates/style.css.html | 169 ++++++++++++++++++++++++++++++++++++++++++++++ templates/style.html | 172 ----------------------------------------------- 3 files changed, 170 insertions(+), 173 deletions(-) create mode 100644 templates/style.css.html delete mode 100644 templates/style.html diff --git a/netlify.toml b/netlify.toml index b75399f..6be8468 100644 --- a/netlify.toml +++ b/netlify.toml @@ -22,4 +22,4 @@ command = "zola build --base-url $DEPLOY_PRIME_URL" X-XSS-Protection = "1; mode=block" Referrer-Policy = "strict-origin-when-cross-origin" Strict-Transport-Security = "max-age=63072000; includeSubdomains" - Content-Security-Policy = "default-src 'none'; img-src 'self'; object-src 'none'; script-src 'none'; style-src 'unsafe-inline'; form-action 'none'; base-uri 'self'; frame-ancestors 'none'" + Content-Security-Policy = "default-src 'none'; img-src 'self'; object-src 'none'; script-src 'none'; style-src 'sha256-2Sbht7dvdhJX00j84akXy9AejYUf6sOM3OpwMxNiDXQ='; form-action 'none'; base-uri 'self'; frame-ancestors 'none'" diff --git a/templates/style.css.html b/templates/style.css.html new file mode 100644 index 0000000..00b4131 --- /dev/null +++ b/templates/style.css.html @@ -0,0 +1,169 @@ + body { + font-family: Verdana, sans-serif; + margin: auto; + padding: 20px; + max-width: 720px; + text-align: left; + background-color: #fff; + word-wrap: break-word; + overflow-wrap: break-word; + line-height: 1.5; + color: #444; + } + + h1, + h2, + h3, + h4, + h5, + h6, + strong, + b { + color: #222; + } + + a { + color: #3273dc; + } + + .title { + text-decoration: none; + border: 0; + } + + .title span { + font-weight: 400; + } + + nav a { + margin-right: 10px; + } + + textarea { + width: 100%; + font-size: 1rem; + } + + input { + font-size: 1rem; + } + + main,article { + line-height: 1.6; + } + + table { + width: 100%; + } + + img { + max-width: 100%; + } + + code { + padding: 2px 5px; + background-color: #f2f2f2; + } + + pre code { + color: #222; + display: block; + padding: 20px; + white-space: pre-wrap; + font-size: 0.875rem; + overflow-x: auto; + } + + div.highlight pre { + background-color: initial; + color: initial; + } + + div.highlight code { + background-color: unset; + color: unset; + } + + blockquote { + border-left: 1px solid #999; + color: #222; + padding-left: 20px; + font-style: italic; + } + + footer { + padding: 25px; + text-align: center; + } + + .helptext { + color: #777; + font-size: small; + } + + .errorlist { + color: #eba613; + font-size: small; + } + + /* blog posts */ + ul.blog-posts { + list-style-type: none; + padding: unset; + } + + ul.blog-posts li { + display: flex; + } + + ul.blog-posts li span { + flex: 0 0 130px; + } + + ul.blog-posts li a:visited { + color: #8b6fcb; + } + + @media (prefers-color-scheme: dark) { + body { + background-color: #333; + color: #ddd; + } + + h1, + h2, + h3, + h4, + h5, + h6, + strong, + b { + color: #eee; + } + + a { + color: #8cc2dd; + } + + code { + background-color: #777; + } + + pre code { + color: #ddd; + } + + blockquote { + color: #ccc; + } + + textarea, + input { + background-color: #252525; + color: #ddd; + } + + .helptext { + color: #aaa; + } + } diff --git a/templates/style.html b/templates/style.html deleted file mode 100644 index 4744695..0000000 --- a/templates/style.html +++ /dev/null @@ -1,172 +0,0 @@ - -- cgit 1.4.1 From f9a560a45d98436c270db6f226f26ccde5dd8844 Mon Sep 17 00:00:00 2001 From: g4m4 Date: Mon, 29 Jan 2024 09:45:17 +0100 Subject: [TEMPLATES] Use the localised version of get_url so multilingual sites can be setup --- templates/nav.html | 2 +- templates/section.html | 2 +- templates/taxonomy_single.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/nav.html b/templates/nav.html index e006ab1..e18fda2 100644 --- a/templates/nav.html +++ b/templates/nav.html @@ -4,7 +4,7 @@ {%- if item.url is matching("https?://") %} {{ item.name }} {%- else %} - {{ item.name }} + {{ item.name }} {%- endif %} {%- endfor %} {%- endif -%} diff --git a/templates/section.html b/templates/section.html index e596ffb..b9eb680 100644 --- a/templates/section.html +++ b/templates/section.html @@ -5,7 +5,7 @@ {%- if taxonomy.term %}

Filtering for "{{ section.title }}"

- Remove filter + Remove filter {%- endif %}
    diff --git a/templates/taxonomy_single.html b/templates/taxonomy_single.html index d5712b0..be0f2ad 100644 --- a/templates/taxonomy_single.html +++ b/templates/taxonomy_single.html @@ -5,7 +5,7 @@ {%- if taxonomy.term %}

    Filtering for "{{ term.name }}"

    - Remove filter + Remove filter {%- endif %}
      -- cgit 1.4.1 From 5e9c829bd70a14ada0818976011b59bf6babbae9 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 9 Feb 2024 14:06:50 +0100 Subject: Display tag header on single-tag pages Fixes https://codeberg.org/alanpearce/zola-bearblog/issues/3 --- templates/taxonomy_single.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/taxonomy_single.html b/templates/taxonomy_single.html index be0f2ad..b46e07f 100644 --- a/templates/taxonomy_single.html +++ b/templates/taxonomy_single.html @@ -2,7 +2,7 @@ {% block main %}
      - {%- if taxonomy.term %} + {%- if term %}

      Filtering for "{{ term.name }}"

      Remove filter -- cgit 1.4.1 From 5f7390ee69cf214b2be78279a97bcadc8d6604e6 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 9 Feb 2024 14:13:23 +0100 Subject: Show heading in taxonomy list page --- templates/taxonomy_list.html | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/taxonomy_list.html b/templates/taxonomy_list.html index 69d9fa2..e5a5cb3 100644 --- a/templates/taxonomy_list.html +++ b/templates/taxonomy_list.html @@ -2,6 +2,7 @@ {% block main %}
      +

      {{ taxonomy.name | capitalize }}

      {% set tags = get_taxonomy(kind="tags") %} -- cgit 1.4.1 From 68fd0902b1b7c540e1b8b79ae02b69b85327e070 Mon Sep 17 00:00:00 2001 From: Oleksii Dobrovolskyi Date: Tue, 13 Feb 2024 16:56:15 +0200 Subject: Adding lang=lang attribute to header.html and page.html --- templates/header.html | 2 +- templates/page.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/header.html b/templates/header.html index c1d3c3e..43f6c40 100644 --- a/templates/header.html +++ b/templates/header.html @@ -1,5 +1,5 @@
      - +

      {{ config.title }}

    -- cgit 1.4.1 From d604fa65ddad76100d9061d35b4129e6c6c5771d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 18 Feb 2024 14:59:47 +0100 Subject: Create optional language switcher --- config.toml | 14 ++++++++++---- templates/header.html | 1 + templates/language_switcher.html | 11 +++++++++++ templates/nav.html | 9 +++++++-- 4 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 templates/language_switcher.html diff --git a/config.toml b/config.toml index 5a54517..92637f3 100644 --- a/config.toml +++ b/config.toml @@ -44,23 +44,29 @@ highlight_code = true [extra] date_format="%d %b, %Y" webserver_sends_csp_headers=true +language_switcher=true + +translations = [ + { code="en", name="English" }, + { code="de", name="Deutsch" }, +] [[extra.main_menu]] -name_en = "Home" +name = "Home" name_de = "Startseite" url = "/" [[extra.main_menu]] -name_en = "Bear" +name = "Bear" name_de = "Bear" url = "@/bear.md" [[extra.main_menu]] -name_en = "Zola" +name = "Zola" name_de = "Zola" url = "@/zola.md" [[extra.main_menu]] -name_en = "Blog" +name = "Blog" name_de = "Blog" url = "@/blog/_index.md" diff --git a/templates/header.html b/templates/header.html index f92e903..6e56025 100644 --- a/templates/header.html +++ b/templates/header.html @@ -1,4 +1,5 @@
    + {% include "language_switcher.html" %}

    {{ config.title }}

    diff --git a/templates/language_switcher.html b/templates/language_switcher.html new file mode 100644 index 0000000..b82ddfc --- /dev/null +++ b/templates/language_switcher.html @@ -0,0 +1,11 @@ +{% if config.extra.language_switcher %} + +{% endif %} diff --git a/templates/nav.html b/templates/nav.html index cd2d391..ac3f44e 100644 --- a/templates/nav.html +++ b/templates/nav.html @@ -7,10 +7,15 @@ {%- if config.extra.main_menu %} {%- for item in config.extra.main_menu %} {% set language_key = 'name_' ~ current_lang %} + {% if current_lang == config.default_language %} + {% set title = item | get(key=language_key, default=item.name) %} + {% else %} + {% set title = item[language_key] %} + {% endif %} {%- if item.url is matching("https?://") %} - {{ item[language_key] }} + {{ title }} {%- else %} - {{ item[language_key] }} + {{ title }} {%- endif %} {%- endfor %} {%- endif -%} -- cgit 1.4.1 From 62014d65b9693908189fd7c73a5dc1062113a72c Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 18 Feb 2024 17:30:09 +0100 Subject: Update netlify style-src hash --- netlify.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlify.toml b/netlify.toml index 59e0094..dc69016 100644 --- a/netlify.toml +++ b/netlify.toml @@ -22,4 +22,4 @@ command = "zola build --base-url $DEPLOY_PRIME_URL" X-XSS-Protection = "1; mode=block" Referrer-Policy = "strict-origin-when-cross-origin" Strict-Transport-Security = "max-age=63072000; includeSubdomains" - Content-Security-Policy = "default-src 'none'; img-src 'self'; object-src 'none'; script-src 'none'; style-src 'sha256-PfqYdfojK4X5lEpBXpUr/pJgf8BZ0tVvD+shnG3tM/E='; form-action 'none'; base-uri 'self'; frame-ancestors 'none'" + Content-Security-Policy = "default-src 'none'; img-src 'self'; object-src 'none'; script-src 'none'; style-src 'sha256-5K5tkbXKXWE7Xcs3HIt98Y+XOWAAsdSyGzixGECKPcA='; form-action 'none'; base-uri 'self'; frame-ancestors 'none'" -- cgit 1.4.1 From cfe243132912e9a21e7de990836380f4356ba92d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 18 Feb 2024 20:38:47 +0100 Subject: Fix nav with default language --- templates/nav.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/nav.html b/templates/nav.html index ac3f44e..ba9f543 100644 --- a/templates/nav.html +++ b/templates/nav.html @@ -6,10 +6,10 @@ {% endif %} {%- if config.extra.main_menu %} {%- for item in config.extra.main_menu %} - {% set language_key = 'name_' ~ current_lang %} {% if current_lang == config.default_language %} - {% set title = item | get(key=language_key, default=item.name) %} + {% set title = item.name %} {% else %} + {% set language_key = 'name_' ~ current_lang %} {% set title = item[language_key] %} {% endif %} {%- if item.url is matching("https?://") %} -- cgit 1.4.1 From 1c52ee3cc089e6b7ef8f38d1e6530b219239bd2e Mon Sep 17 00:00:00 2001 From: g4m4 Date: Mon, 19 Feb 2024 17:18:16 +0100 Subject: Translation link now pointing to the translation of the current page --- templates/language_switcher.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/templates/language_switcher.html b/templates/language_switcher.html index b82ddfc..d3cd383 100644 --- a/templates/language_switcher.html +++ b/templates/language_switcher.html @@ -1,10 +1,15 @@ {% if config.extra.language_switcher %} -- cgit 1.4.1 From 21091740f78eb4653cfc7e1dceba6f8856f3d210 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 20 Feb 2024 17:04:48 +0100 Subject: Show language switcher on all pages --- templates/language_switcher.html | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/templates/language_switcher.html b/templates/language_switcher.html index d3cd383..a300028 100644 --- a/templates/language_switcher.html +++ b/templates/language_switcher.html @@ -1,15 +1,11 @@ {% if config.extra.language_switcher %} -- cgit 1.4.1 From f138825a20271b4c117ddd42ea6749a4378a9efb Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 20 Feb 2024 17:05:02 +0100 Subject: Add missing trailing slash to translation links --- templates/language_switcher.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/language_switcher.html b/templates/language_switcher.html index a300028..3af5e66 100644 --- a/templates/language_switcher.html +++ b/templates/language_switcher.html @@ -5,7 +5,7 @@ {%- if tr.code == lang %} {{ tr.name }} {%- else %} - {{ tr.name }} + {{ tr.name }} {%- endif %} {%- endfor %} -- cgit 1.4.1 From fa345b1d1e11cc66ed92605382887fd4367ef97a Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 20 Feb 2024 17:08:59 +0100 Subject: Make language switcher more semantic --- templates/language_switcher.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/language_switcher.html b/templates/language_switcher.html index 3af5e66..3968c73 100644 --- a/templates/language_switcher.html +++ b/templates/language_switcher.html @@ -1,11 +1,11 @@ {% if config.extra.language_switcher %} -