Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/amzrk2/hugo-theme-fuji.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoramzrk2 <amzrk2@outlook.com>2020-12-22 07:40:39 +0300
committeramzrk2 <amzrk2@outlook.com>2020-12-22 07:40:39 +0300
commit5c307e15cae258cce5d271c46d5d64b8ea26dae0 (patch)
treee64ca74d784ae25933ab957855c75e0ffaaf18f0 /layouts
parent079898488dc43dccf50e34ec8c42c9e827234f24 (diff)
fix: #61, `showToc` not work as expected
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/sidebar.html10
1 files changed, 6 insertions, 4 deletions
diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html
index 6847375..1d6ae92 100644
--- a/layouts/partials/sidebar.html
+++ b/layouts/partials/sidebar.html
@@ -33,13 +33,15 @@
</div>
</div>
<!-- in-post toc -->
- {{ if .IsPage }}
- {{ if and (ne .Site.Params.showToc false) (ne .Params.showToc false) }}
+ {{- if .IsPage -}}
+ {{- $pageShowToc := .Params.showToc -}}
+ {{- $siteShowToc := .Site.Params.showToc -}}
+ {{- if or ($pageShowToc) (and (ne $pageShowToc false) (ne $siteShowToc false)) -}}
<div class="sidebar-item sidebar-toc">
<h3>{{ i18n "sidebarToc" }}</h3>
- {{ .TableOfContents }}
+ {{- .TableOfContents -}}
</div>
- {{ end }}
+ {{- end -}}
{{ else }}
{{ with .Site.Params.bgmImageChart }}
<!-- bgm.tv image chart -->