From f1edbba8bd81a9f4253c582b95af1797ab828cff Mon Sep 17 00:00:00 2001 From: welpo Date: Sat, 19 Aug 2023 01:26:27 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8feat(footer/copyright):=20replace=20"$?= =?UTF-8?q?SEPARATOR"=20to=20`separator`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Expands on #112 --- config.toml | 3 ++- templates/partials/footer.html | 4 ++-- theme.toml | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/config.toml b/config.toml index 42488e1..ca5c4f4 100644 --- a/config.toml +++ b/config.toml @@ -235,8 +235,9 @@ socials = [ # Enable a copyright notice for the footer, shown between socials and the "Powered by" text. # You can use $CURRENT_YEAR to automatically insert the current year. +# $SEPARATOR will be replaced by the `separator` variable. # Markdown is supported (links, emphasis, etc). -# copyright = "© $CURRENT_YEAR Your Name • Unless otherwise noted, the content in this website is available under the [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/) license." +# copyright = "© $CURRENT_YEAR Your Name $SEPARATOR Unless otherwise noted, the content in this website is available under the [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/) license." # For multi-language sites, you can set a different copyright for each language. # If this is set to true, ensure you have a `copyright` translation for each language. diff --git a/templates/partials/footer.html b/templates/partials/footer.html index b241edf..439d089 100644 --- a/templates/partials/footer.html +++ b/templates/partials/footer.html @@ -56,9 +56,9 @@ {% set current_year = now() | date(format="%Y") %} {# Translate the copyright if set in the config #} {%- if config.extra.translate_copyright and lang != config.default_language -%} -

{{ trans(key="copyright", lang=lang) | replace(from="$CURRENT_YEAR", to=current_year) | markdown | safe }}

+

{{ trans(key="copyright", lang=lang) | replace(from="$CURRENT_YEAR", to=current_year) | replace(from="$SEPARATOR", to=separator) | markdown | safe }}

{%- else -%} -

{{ config.extra.copyright | replace(from="$CURRENT_YEAR", to=current_year) | markdown | safe }}

+

{{ config.extra.copyright | replace(from="$CURRENT_YEAR", to=current_year) | replace(from="$SEPARATOR", to=separator) | markdown | safe }}

{%- endif -%} {%- endif -%} diff --git a/theme.toml b/theme.toml index 61d8efa..b80b3b8 100644 --- a/theme.toml +++ b/theme.toml @@ -120,8 +120,9 @@ socials = [ # Enable a copyright notice for the footer, shown between socials and the "Powered by" text. # You can use $CURRENT_YEAR to automatically insert the current year. +# $SEPARATOR will be replaced by the `separator` variable. # Markdown is supported (links, emphasis, etc). -# copyright = "© $CURRENT_YEAR Your Name • Unless otherwise noted, the content in this website is available under the [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/) license." +# copyright = "© $CURRENT_YEAR Your Name $SEPARATOR Unless otherwise noted, the content in this website is available under the [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/) license." # For multi-language sites, you can set a different copyright for each language. # If this is set to true, ensure you have a `copyright` translation for each language.