Skip to content

Commit 5b84fcb

Browse files
committed
fix: 修复 TOC 状态设置逻辑,确保正确显示 TOC 对话框
1 parent 954c29e commit 5b84fcb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

layouts/projects.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
{{- $contentToc := ne $tableOfContents `<nav id="TableOfContents"></nav>` -}}
1818
{{- $hasToc := $contentToc | or (gt (len $data) 0) | or (gt (len $pages) 0) -}}
1919
{{- $showToc := $toc.enable | and $hasToc -}}
20+
{{- .Store.Set "showToc" $showToc -}}
2021
{{- $localData := newScratch -}}
2122
{{- $pageCount := 0 -}}
2223
{{- /* Paginate before content */ -}}
@@ -227,7 +228,6 @@ <h2 class="toc-title{{ with $params.password }} encrypted-hidden{{ end }}">
227228

228229
{{- /* TOC Dialog */ -}}
229230
{{- if $showToc -}}
230-
{{- .Page.Store.Set "hasToc" true -}}
231231
<dialog id="toc-dialog" aria-labelledby="toc-dialog-title" role="dialog">
232232
<div class="toc">
233233
<h2 class="toc-title">{{ T "single.contents" }}</h2>

0 commit comments

Comments
 (0)