From acf01bfb7842c52aab4af8fe599b6b3662b7b3e6 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Tue, 3 Oct 2023 19:36:14 -0700 Subject: create/skeletons: Fix menu template Check identifier existence before calling lang.Translate to prevent empty warnings when using the --printI18nWarnings flag. Closes #11519 --- create/skeletons/theme/layouts/partials/menu.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'create/skeletons/theme/layouts') diff --git a/create/skeletons/theme/layouts/partials/menu.html b/create/skeletons/theme/layouts/partials/menu.html index 8f72130d0..718318096 100644 --- a/create/skeletons/theme/layouts/partials/menu.html +++ b/create/skeletons/theme/layouts/partials/menu.html @@ -27,6 +27,12 @@ Renders a menu for the given menu ID. {{- else if $page.HasMenuCurrent .Menu .}} {{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }} {{- end }} + {{- $name := .Name }} + {{- with .Identifier }} + {{- with T . }} + {{- $name = . }} + {{- end }} + {{- end }}
  • {{ or (T .Identifier) .Name | safeHTML }} + >{{ $name }} {{- with .Children }}