From f9c18b03987a7077301992f8369f4de75e270a2a Mon Sep 17 00:00:00 2001 From: welpo Date: Tue, 1 Aug 2023 14:11:05 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20optional=20trailing=20slash?= =?UTF-8?q?=20in=20menu=20links?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enabled by default. Drops the `$BASE_URL` transformation to avoid confusion (#99). --- config.toml | 8 ++++---- templates/partials/footer.html | 2 +- templates/partials/nav.html | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/config.toml b/config.toml index 1b2bd5e..3b55b7b 100644 --- a/config.toml +++ b/config.toml @@ -162,10 +162,10 @@ favicon_emoji = "🌱" headerImage = "" menu = [ - { name = "blog", url = "blog/" }, - { name = "archive", url = "archive/" }, - { name = "tags", url = "tags/" }, - { name = "projects", url = "projects/" }, + { name = "blog", url = "blog", trailing_slash = true }, + { name = "archive", url = "archive", trailing_slash = true }, + { name = "tags", url = "tags", trailing_slash = true }, + { name = "projects", url = "projects", trailing_slash = true }, ] # The RSS icon will be shown if (1) it's enabled and (2) the following variable is set to true. diff --git a/templates/partials/footer.html b/templates/partials/footer.html index fa97d9e..f6df6ea 100644 --- a/templates/partials/footer.html +++ b/templates/partials/footer.html @@ -12,7 +12,7 @@ {%- endif -%} {% for social in config.extra.socials %}
  • -
  • diff --git a/templates/partials/nav.html b/templates/partials/nav.html index be1e159..4c98be9 100644 --- a/templates/partials/nav.html +++ b/templates/partials/nav.html @@ -10,7 +10,8 @@ {%- if config.extra.menu %} {% for menu in config.extra.menu %}
  • - + {% set trailing_slash = menu.trailing_slash | default(value=true) %} + {%- if lang != config.default_language -%} {{ trans(key=menu.name | safe, lang=lang) }} {%- else -%}