From 2004648076f6e7de4fbbeb758d7e599e398e07af Mon Sep 17 00:00:00 2001 From: Xin Date: Tue, 30 Apr 2024 23:54:06 +0100 Subject: [PATCH] fix: class name in render-data --- layouts/partials/components/sidebar/get-section-data.html | 6 +++--- layouts/partials/components/sidebar/render-data.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/layouts/partials/components/sidebar/get-section-data.html b/layouts/partials/components/sidebar/get-section-data.html index a93bad0..1aca25a 100644 --- a/layouts/partials/components/sidebar/get-section-data.html +++ b/layouts/partials/components/sidebar/get-section-data.html @@ -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 }} diff --git a/layouts/partials/components/sidebar/render-data.html b/layouts/partials/components/sidebar/render-data.html index f72a4a4..41750cd 100644 --- a/layouts/partials/components/sidebar/render-data.html +++ b/layouts/partials/components/sidebar/render-data.html @@ -7,7 +7,7 @@ {{- $containsPage := hasPrefix $pageLink .link -}} {{- $shouldOpen := or (.open) $containsPage $active | default false -}} -
  • {{- 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) -}}