add toc
This commit is contained in:
parent
1ce071cd4d
commit
d328aedebe
8 changed files with 44 additions and 17 deletions
|
@ -1,4 +1,7 @@
|
|||
{{ define "main" }}
|
||||
{{ if .Params.toc }}
|
||||
{{ partial "toc.html" . }}
|
||||
{{ end }}
|
||||
<main>
|
||||
<h1>{{ .Title }}</h1>
|
||||
<div class="sm-1 mtb-1">
|
||||
|
@ -14,17 +17,16 @@
|
|||
{{ .Content }}
|
||||
</article>
|
||||
</main>
|
||||
{{ if or .Params.math .Site.Params.math }}
|
||||
{{ partial "math.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if and .Params.comment (eq .Site.Params.comment "disqus")}}
|
||||
{{ partial "disqus.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if and .Params.comment (eq .Site.Params.comment "ovo")}}
|
||||
{{ partial "ovo.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if or .Params.math .Site.Params.math }}
|
||||
{{ partial "math.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if and .Params.comment (eq .Site.Params.comment "disqus")}}
|
||||
{{ partial "disqus.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if and .Params.comment (eq .Site.Params.comment "ovo")}}
|
||||
{{ partial "ovo.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
6
layouts/partials/toc.html
Normal file
6
layouts/partials/toc.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
<details class="toc">
|
||||
<summary class="btn">Table of Contents</summary>
|
||||
<div>
|
||||
{{ .TableOfContents }}
|
||||
</div>
|
||||
</details>
|
Loading…
Add table
Add a link
Reference in a new issue