forked from drowl87/hextra_mirror
feat: generate sidebar json data for rendering
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
{{- range .data -}}
|
||||
{{- $active := or (eq $pageLink .link) (eq (strings.TrimSuffix "/" $pageLink) .link) -}}
|
||||
{{- $containsPage := hasPrefix $pageLink .link -}}
|
||||
{{- $shouldOpen := or (.open) $containsPage $active | default true -}}
|
||||
{{- $shouldOpen := or (.open) $containsPage $active | default false -}}
|
||||
|
||||
<li class="{{ if $shouldOpen }}open{{ end }}">
|
||||
{{- partial "components/sidebar/item-link" (dict "active" $active "title" .title "link" .link "items" .items) -}}
|
||||
|
Reference in New Issue
Block a user