Add a table of contents

Create a new table_of_contents partial that includes an auto-generated table of contents if the word
count is over 400 and the "toc" page variable has been set true.
This commit is contained in:
Eryn Wells 2023-04-23 22:02:11 +09:00
parent 6eeeb11ab4
commit f21ac49b08
3 changed files with 11 additions and 1 deletions

View file

@ -0,0 +1,8 @@
{{ if and (gt .WordCount 400) .Params.toc }}
<aside>
<details open>
<summary>Table of Contents</summary>
{{ .TableOfContents }}
</details>
</aside>
{{ end }}