From 62e9e07d15ec5b5a95b7eb2615fb33e08a784683 Mon Sep 17 00:00:00 2001 From: Naty <9094039+eclecticpassions@users.noreply.github.com> Date: Fri, 17 Oct 2025 23:12:45 +0000 Subject: [PATCH] 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. --- layouts/_partials/docs/toc-show.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/layouts/_partials/docs/toc-show.html b/layouts/_partials/docs/toc-show.html index b8878cd..d54c312 100644 --- a/layouts/_partials/docs/toc-show.html +++ b/layouts/_partials/docs/toc-show.html @@ -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 "")) - (default .Site.Params.BookToC .Params.BookToC) --}} \ No newline at end of file +-}}