From 2bc605480ebc7bcf130dfc43e811ede0fc4376b7 Mon Sep 17 00:00:00 2001 From: CcydtN <51289140+CcydtN@users.noreply.github.com> Date: Sun, 29 Jan 2023 04:07:04 +0800 Subject: [PATCH] feat(i18n): Allow localizing menus with i18n dynamically --- layouts/partials/sidebar/left.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/partials/sidebar/left.html b/layouts/partials/sidebar/left.html index 32e5a12..4f501f3 100644 --- a/layouts/partials/sidebar/left.html +++ b/layouts/partials/sidebar/left.html @@ -62,7 +62,7 @@ {{ range .Site.Menus.main }} {{ $active := or (eq $currentPage.Title .Name) (or ($currentPage.HasMenuCurrent "main" .) ($currentPage.IsMenuCurrent "main" .)) }}
  • - + {{ $icon := default .Pre .Params.Icon }} {{ if .Pre }} {{ warnf "Menu item [%s] is using [pre] field to set icon, please use [params.icon] instead.\nMore information: https://docs.stack.jimmycai.com/configuration/custom-menu.html" .URL }} @@ -70,7 +70,7 @@ {{ with $icon }} {{ partial "helper/icon" . }} {{ end }} - {{- .Name -}} + {{ i18n .Identifier | default .Name}}
  • {{ end }}