hugo-theme-stack/layouts/partials/widget/toc.html
fantasime 787425b911 feat(widgets): change widget icon or make it invisible. (#1120)
User can disable icon using `widgets.[home]page.iconVisible`,
and change widget icon using `widgets.[home]page.icon`.
2025-02-04 02:48:29 +08:00

16 lines
571 B
HTML

{{ if (.Context.Scratch.Get "TOCEnabled") }}
<section class="widget archives">
<div class="widget-icon">
{{ $icon := default "hash" .Params.icon }}
{{ $iconVisible := default true .Params.iconVisible }}
{{ if $iconVisible }}
{{ partial "helper/icon" $icon }}
{{ end }}
</div>
<h2 class="widget-title section-title">{{ T "article.tableOfContents" }}</h2>
<div class="widget--toc">
{{ .Context.TableOfContents }}
</div>
</section>
{{ end }}