From 5c8bed5c6a5feb3d353f40b5254fcd32e0e2bf4f Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sat, 19 Nov 2022 11:18:57 -0800 Subject: [PATCH] feat: allow enableToc to override default no TOC on a per-page basis --- layouts/partials/toc.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html index acad6fe7..bd0cb541 100644 --- a/layouts/partials/toc.html +++ b/layouts/partials/toc.html @@ -1,5 +1,5 @@ {{ $hasHeaders := gt (len (findRE "(.|\n)*?" .Content)) 0 }} -{{ if (and $.Site.Data.config.enableToc (ne .Params.enableToc false) $hasHeaders) }} +{{ if (or (and (not $.Site.Data.config.enableToc) .Params.enableToc) (and $.Site.Data.config.enableToc (ne .Params.enableToc false) $hasHeaders)) }}