Refactor condition for Table of Contents display (#776)

Fix `bookToC` not responding to `true` or `false` globally (Hugo config) or locally (front matter) by simplifying the logic and making TOC behaviour consistent across all page types.
This commit is contained in:
Naty
2025-10-17 23:12:45 +00:00
committed by GitHub
parent 836a8a82d6
commit 62e9e07d15
+3 -3
View File
@@ -1,5 +1,5 @@
{{- return or
(and (eq .Type "posts") (eq .Kind "section"))
{{- return and
(not (eq .Params.bookToC false))
(not (eq .Site.Params.BookToC false))
(not (eq .TableOfContents "<nav id=\"TableOfContents\"></nav>"))
(default .Site.Params.BookToC .Params.BookToC)
-}}