Change logic on rendering or not ToC

This commit is contained in:
Alex Shpak
2025-10-09 23:33:20 +02:00
parent 6baf098e54
commit 7f5bede532
3 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -1,4 +1,5 @@
{{ return default
{{- return or
(and (eq .Type "posts") (eq .Kind "section"))
(not (eq .TableOfContents "<nav id=\"TableOfContents\"></nav>"))
(default .Site.Params.BookToC .Params.BookToC)
}}
-}}
+1 -1
View File
@@ -52,7 +52,7 @@
{{ define "header" }}
{{ partial "docs/header" . }}
{{ if default true (default .Site.Params.BookToC .Params.BookToC) }}
{{ if partial "docs/toc-show" . }}
<aside class="hidden">
{{ template "toc" . }}
</aside>