From 6d00e42b03684f49305d794f569f10fe9b3f61ab Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Fri, 28 Nov 2025 14:38:26 +0800 Subject: [PATCH] feat(i): update TOC dialog logic to use 'hasToc' instead of 'enableTocDialog' --- layouts/_partials/init/index.html | 2 +- layouts/_partials/widgets.html | 2 +- layouts/posts/single.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/layouts/_partials/init/index.html b/layouts/_partials/init/index.html index 3c31328d..d12de1d5 100644 --- a/layouts/_partials/init/index.html +++ b/layouts/_partials/init/index.html @@ -1,4 +1,4 @@ -{{- hugo.Store.Set "version" "v0.4.0-alpha.3-20251124100610-99fd4fb7" -}} +{{- hugo.Store.Set "version" "v0.4.0-alpha.3-20251128063828-ffe0c3bd" -}} {{- .Store.Set "this" dict -}} {{- partial "init/detection-env.html" . -}} diff --git a/layouts/_partials/widgets.html b/layouts/_partials/widgets.html index 81786064..24e1ed44 100644 --- a/layouts/_partials/widgets.html +++ b/layouts/_partials/widgets.html @@ -17,7 +17,7 @@ {{- end -}} {{- /* toc dialog button */ -}} - {{- if .Page.Store.Get "enableTocDialog" -}} + {{- if .Page.Store.Get "hasToc" -}}
{{- dict "Class" "fa-solid fa-bars fa-fw" | partial "plugin/icon.html" -}}
diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 2e33fd3e..1ea5c895 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -236,7 +236,7 @@ {{- /* TOC Dialog */ -}} {{- if $showToc -}} - {{- .Page.Store.Set "enableTocDialog" true -}} + {{- .Page.Store.Set "hasToc" true -}}

{{ T "single.contents" }}