fix(single.html): toc not controlled by frontmatter (redo #2428)

This commit is contained in:
ZhenShuo Leo
2025-10-06 10:20:36 +08:00
parent 9b35cc2bae
commit 9a043d83ab

View File

@@ -31,7 +31,8 @@
{{/* Body */}}
<section class="flex flex-col max-w-full mt-0 prose dark:prose-invert lg:flex-row">
{{ $enableToc := .Params.showTableOfContents | default (site.Params.list.showTableOfContents | default false) }}
{{ $enableToc := site.Params.article.showTableOfContents | default false }}
{{ $enableToc = .Params.showTableOfContents | default $enableToc }}
{{ $showToc := and $enableToc (in .TableOfContents "<ul") }}
{{ $topClass := cond (hasPrefix site.Params.header.layout "fixed") "lg:top-[140px]" "lg:top-10" }}
{{ if $showToc }}