fix: update TOC manual disable check to read default site parameter (#1341)

* fix: update TOC manual disable check to read default site parameter

* Article -> article

* Undo formatting

* fix: simplify TOC enabled logic by removing manual disable check
This commit is contained in:
Jimmy
2026-05-25 10:43:36 +02:00
committed by GitHub
parent 03bf8b0c3f
commit e409eddf5c
+1 -2
View File
@@ -15,8 +15,7 @@
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- $TOCManuallyDisabled := eq .Params.toc false -}} {{- $TOCEnabled := and (default .Site.Params.article.toc .Params.toc) $TOCWidgetEnabled -}}
{{- $TOCEnabled := and (not $TOCManuallyDisabled) $TOCWidgetEnabled -}}
{{- $hasTOC := ge (len .TableOfContents) 100 -}} {{- $hasTOC := ge (len .TableOfContents) 100 -}}
{{- .Scratch.Set "TOCEnabled" (and $TOCEnabled $hasTOC) -}} {{- .Scratch.Set "TOCEnabled" (and $TOCEnabled $hasTOC) -}}