From 12c8dd698df54eca517edfa73523539dbd069797 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Thu, 21 Aug 2025 07:49:00 +0200 Subject: [PATCH] fix(language-switch): manage icon menu item after the language switcher --- layouts/_partials/navbar.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/layouts/_partials/navbar.html b/layouts/_partials/navbar.html index 932de36..9621a86 100644 --- a/layouts/_partials/navbar.html +++ b/layouts/_partials/navbar.html @@ -31,17 +31,17 @@ {{- end -}} {{- end -}} - {{/* Display icon menu item */}} - {{- if .Params.icon -}} + {{- if eq .Params.type "theme-toggle" -}} + {{- partial "theme-toggle.html" (dict "iconHeight" $iconHeight "hideLabel" (not .Params.label) "iconHeight" $iconHeight "location" "top" "class" "hx:p-2") -}} + {{- else if eq .Params.type "language-switch" -}} + {{- partial "language-switch" (dict "context" $page "grow" false "hideLabel" (not .Params.label) "iconName" (.Params.icon | default "translate") "iconHeight" $iconHeight "location" "top" "class" "hx:p-2") -}} + {{- else if .Params.icon -}} + {{/* Display icon menu item */}} {{- $rel := cond (eq .Params.icon "mastodon") "noreferrer me" "noreferrer" }} {{- partial "utils/icon.html" (dict "name" .Params.icon "attributes" (printf "height=%d" $iconHeight)) -}} {{ or (T .Identifier) .Name | safeHTML }} - {{- else if eq .Params.type "theme-toggle" -}} - {{- partial "theme-toggle.html" (dict "iconHeight" $iconHeight "hideLabel" (not .Params.label) "iconHeight" $iconHeight "location" "top" "class" "hx:p-2") -}} - {{- else if eq .Params.type "language-switch" -}} - {{- partial "language-switch" (dict "context" $page "grow" false "hideLabel" (not .Params.label) "iconName" (.Params.icon | default "translate") "iconHeight" $iconHeight "location" "top" "class" "hx:p-2") -}} {{- else -}} {{- $active := or ($currentPage.HasMenuCurrent "main" .) ($currentPage.IsMenuCurrent "main" .) -}} {{- $activeClass := cond $active "hx:font-medium" "hx:text-gray-600 hx:hover:text-gray-800 hx:dark:text-gray-400 hx:dark:hover:text-gray-200" -}}