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:
@@ -1,5 +1,5 @@
|
|||||||
{{- return or
|
{{- return and
|
||||||
(and (eq .Type "posts") (eq .Kind "section"))
|
(not (eq .Params.bookToC false))
|
||||||
|
(not (eq .Site.Params.BookToC false))
|
||||||
(not (eq .TableOfContents "<nav id=\"TableOfContents\"></nav>"))
|
(not (eq .TableOfContents "<nav id=\"TableOfContents\"></nav>"))
|
||||||
(default .Site.Params.BookToC .Params.BookToC)
|
-}}
|
||||||
-}}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user