Fix menu template

This commit is contained in:
Joe Mooring 2023-10-03 19:24:58 -07:00 committed by GitHub
parent f5d2f5ed49
commit 0338d7c711
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,6 +49,12 @@ This partial template recursively "walks" a menu structure, rendering a localize
{{- else if $page.HasMenuCurrent .Menu .}} {{- else if $page.HasMenuCurrent .Menu .}}
{{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }} {{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }}
{{- end }} {{- end }}
{{- $name := .Name }}
{{- with .Identifier }}
{{- with T . }}
{{- $name = . }}
{{- end }}
{{- end }}
<li> <li>
<a <a
{{- range $k, $v := $attrs }} {{- range $k, $v := $attrs }}
@ -56,7 +62,7 @@ This partial template recursively "walks" a menu structure, rendering a localize
{{- printf " %s=%q" $k $v | safeHTMLAttr }} {{- printf " %s=%q" $k $v | safeHTMLAttr }}
{{- end }} {{- end }}
{{- end -}} {{- end -}}
>{{ or (T .Identifier) .Name | safeHTML }}</a> >{{ $name }}</a>
{{- with .Children }} {{- with .Children }}
<ul> <ul>
{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }} {{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}