fix: class name in render-data

This commit is contained in:
Xin 2024-04-30 23:54:06 +01:00
parent 0da6f97e99
commit 2004648076
2 changed files with 4 additions and 4 deletions

View File

@ -5,14 +5,14 @@
*/}}
{{ $data := "" }}
{{ $section := .Section | default "" }}
{{ $sidebarKey := "sidebar" }}
{{ $filename := "sidebar" }}
{{ if hugo.IsMultilingual }}
{{ with (index site.Data site.Language.Lang $sidebarKey $section) }}
{{ with (index site.Data site.Language.Lang $filename $section) }}
{{ $data = . }}
{{ end }}
{{ else }}
{{ with (index site.Data $sidebarKey $section) }}
{{ with (index site.Data $filename $section) }}
{{ $data = . }}
{{ end }}
{{ end }}

View File

@ -7,7 +7,7 @@
{{- $containsPage := hasPrefix $pageLink .link -}}
{{- $shouldOpen := or (.open) $containsPage $active | default false -}}
<li class="sidebar-item-list {{ if $shouldOpen }}open{{ end }}">
<li class="hextra-sidebar-item {{ if $shouldOpen }}open{{ end }}">
{{- partial "components/sidebar/item-link" (dict "active" $active "title" .title "link" .link "items" .items) -}}
{{- if .items -}}
{{- partial "components/sidebar/render-items" (dict "items" .items "link" $pageLink "cached" $cached) -}}