hugo-theme-anubis2/layouts/partials/toc.html

20 lines
604 B
HTML
Raw Normal View History

2024-03-04 12:15:27 +01:00
{{ $toc := and ($.Site.Params.toc) (ge .WordCount $.Site.Params.tocWordCount) }} {{ if isset .Params "toc" }} {{ $toc = .Params.toc }} {{ end }} {{ if $toc }}
2024-03-04 12:34:27 +01:00
<details class="toc noselect">
2024-03-04 12:15:27 +01:00
<summary>Table of Contents</summary>
<div class="inner">{{ .TableOfContents }}</div>
</details>
2023-07-04 21:29:38 +02:00
{{ end }}
2024-03-04 12:40:18 +01:00
<!-- <script>
2024-03-04 12:15:27 +01:00
document.querySelector(".toc").addEventListener("click", function () {
event.preventDefault();
if (this.open) {
this.open = false;
this.classList.remove("expanded");
} else {
this.open = true;
this.classList.add("expanded");
}
});
2024-03-04 12:40:18 +01:00
</script> -->