mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
fix: update TOC handling logic to use showToc flag
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
{{- $toc := .Store.Get "toc" -}}
|
||||
{{- $tableOfContents := .Fragments.ToHTML ($toc.startlevel | int) ($toc.endlevel | int) ($toc.ordered | default false) -}}
|
||||
{{- $showToc := $toc.enable | and (ne $tableOfContents `<nav id="TableOfContents"></nav>`) -}}
|
||||
{{- .Store.Set "showToc" $showToc -}}
|
||||
{{- $tableOfContents = dict "Content" $tableOfContents "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}
|
||||
|
||||
<aside class="aside-collection animate__animated animate__fadeIn animate__faster" aria-label="{{ T "collections" }}">
|
||||
@@ -234,7 +235,6 @@
|
||||
|
||||
{{- /* TOC Dialog */ -}}
|
||||
{{- if $showToc -}}
|
||||
{{- .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>
|
||||
|
||||
Reference in New Issue
Block a user