diff options
author | Alexander Neonxp Kiryukhin <i@neonxp.ru> | 2024-12-15 15:10:57 +0300 |
---|---|---|
committer | Alexander Neonxp Kiryukhin <i@neonxp.ru> | 2024-12-15 15:10:57 +0300 |
commit | 314fd719d318ebba7c85e50e621c021179054290 (patch) | |
tree | f4c6e2f71bfe0d489933c4ba34d5d04d1ba6d117 /layouts/partials/walk.html | |
parent | 47fc02a8c71af4926148beb5d5cc0fc221aa5429 (diff) |
Auto-commit 2024-12-15
Diffstat (limited to 'layouts/partials/walk.html')
-rw-r--r-- | layouts/partials/walk.html | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/layouts/partials/walk.html b/layouts/partials/walk.html index e115d6f..addf6f6 100644 --- a/layouts/partials/walk.html +++ b/layouts/partials/walk.html @@ -1,10 +1,9 @@ {{- $page := .page }} {{- range .menuEntries }} {{- $attrs := dict "href" .URL }} + {{- $attrs = merge $attrs (dict "class" "nav-link") }} {{- if $page.IsMenuCurrent .Menu . }} - {{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }} - {{- else if $page.HasMenuCurrent .Menu .}} - {{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }} + {{- $attrs = merge $attrs (dict "class" "active nav-link" "aria-current" "page") }} {{- end }} {{- $name := .Name }} {{- with .Identifier }} @@ -15,10 +14,15 @@ <li class="nav-item {{if .Children}}dropdown{{end}}"> <a {{if .Children}} - class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false" - {{ else }} - class="nav-link" href="{{.URL}}" + role="button" + data-bs-toggle="dropdown" + aria-expanded="false" {{ end }} + {{- range $k, $v := $attrs }} + {{- with $v }} + {{- printf " %s=%q" $k $v | safeHTMLAttr }} + {{- end }} + {{- end -}} >{{ $name }}</a> {{- with .Children }} <ul class="dropdown-menu"> |