feat(i): update TOC dialog logic to use 'hasToc' instead of 'enableTocDialog'

This commit is contained in:
Cell
2025-11-28 14:38:26 +08:00
parent ffe0c3bd67
commit 6d00e42b03
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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" . -}}
+1 -1
View File
@@ -17,7 +17,7 @@
</div>
{{- end -}}
{{- /* toc dialog button */ -}}
{{- if .Page.Store.Get "enableTocDialog" -}}
{{- if .Page.Store.Get "hasToc" -}}
<div id="toc-drawer-button" class="fixed-button toc-drawer-button d-none{{ with $params.password }} encrypted-hidden{{ end }}" role="button" aria-label="{{ T `single.contents` }}">
{{- dict "Class" "fa-solid fa-bars fa-fw" | partial "plugin/icon.html" -}}
</div>
+1 -1
View File
@@ -236,7 +236,7 @@
{{- /* TOC Dialog */ -}}
{{- if $showToc -}}
{{- .Page.Store.Set "enableTocDialog" true -}}
{{- .Page.Store.Set "hasToc" true -}}
<dialog id="toc-dialog" aria-labelledby="toc-dialog-title" role="dialog">
<div class="toc">
<h2 class="toc-title">{{ T "single.contents" }}</h2>