add table of contents
This commit is contained in:
parent
1b974ce9d3
commit
b517159c0e
13 changed files with 161 additions and 23 deletions
|
@ -5,9 +5,21 @@
|
|||
<span class="post__subtitle">
|
||||
{{.}}
|
||||
</span>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ partial "page-single/post-meta.html" . }}
|
||||
</header>
|
||||
{{ $tableOfContents := .TableOfContents }}
|
||||
{{ with .Site.Params.toc }}
|
||||
<div class="toc-wrapper">
|
||||
<input type="checkbox" id="tocToggle">
|
||||
<label for="tocToggle">Table of Content</label>
|
||||
{{ if eq . "hugo" }}
|
||||
{{ $tableOfContents }}
|
||||
{{ else if eq . "tocbot"}}
|
||||
<div class="toc" id="TableOfContents"></div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="post">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue