treefmt: fix config, add prettier-plugin-go-template

This commit is contained in:
Jan Kremer 2024-10-17 17:41:01 +02:00
parent 6ccec6f792
commit 9e8f680c52
Signed by: jan
GPG key ID: A7DA689CB3B078EC
10 changed files with 137 additions and 85 deletions

View file

@ -1,12 +1,12 @@
{{- /*
Renders a menu for the given menu ID.
Renders a menu for the given menu ID.
@context {page} page The current page.
@context {string} menuID The menu ID.
@context {page} page The current page.
@context {string} menuID The menu ID.
@example: {{ partial "menu.html" (dict "menuID" "main" "page" .) }}
@example: {{ partial "menu.html" (dict "menuID" "main" "page" .)
}}
*/}}
{{- $page := .page }}
{{- $menuID := .menuID }}
@ -24,7 +24,7 @@ Renders a menu for the given menu ID.
{{- $attrs := dict "href" .URL }}
{{- if $page.IsMenuCurrent .Menu . }}
{{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }}
{{- else if $page.HasMenuCurrent .Menu .}}
{{- else if $page.HasMenuCurrent .Menu . }}
{{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }}
{{- end }}
{{- $name := .Name }}
@ -40,7 +40,8 @@ Renders a menu for the given menu ID.
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
{{- end }}
{{- end -}}
>{{ $name }}</a>
>{{ $name }}</a
>
{{- with .Children }}
<ul>
{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}