From 7f9f58860dc98038798e362e52c5d39c750858cb 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 acad6fe70..bd0cb541f 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)) }}