feat: hide toc for short notes
This commit is contained in:
parent
0c0a755162
commit
3bcfa8936a
@ -22,14 +22,7 @@
|
||||
<li><a href="{{ .Permalink }}">{{ .LinkTitle | humanize }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ if (and $.Site.Data.config.enableToc (ne .Params.enableToc false)) }}
|
||||
<aside class="mainTOC">
|
||||
<details {{ if $.Site.Data.config.openToc }}open {{ end }}>
|
||||
<summary>Table of Contents</summary>
|
||||
{{ .TableOfContents }}
|
||||
</details>
|
||||
</aside>
|
||||
{{end}}
|
||||
{{partial "toc.html" .}}
|
||||
{{partial "textprocessing.html" . }}
|
||||
</article>
|
||||
{{partial "footer.html" .}}
|
||||
|
@ -13,14 +13,7 @@
|
||||
{{partial "darkmode.html" .}}
|
||||
</header>
|
||||
<article>
|
||||
{{ if (and $.Site.Data.config.enableToc (ne .Params.enableToc false)) }}
|
||||
<aside class="mainTOC">
|
||||
<details {{ if $.Site.Data.config.openToc }}open {{ end }}>
|
||||
<summary>Table of Contents</summary>
|
||||
{{ .TableOfContents }}
|
||||
</details>
|
||||
</aside>
|
||||
{{end}}
|
||||
{{partial "toc.html" .}}
|
||||
{{partial "textprocessing.html" . }}
|
||||
</article>
|
||||
{{partial "footer.html" .}}
|
||||
|
8
layouts/partials/toc.html
Normal file
8
layouts/partials/toc.html
Normal file
@ -0,0 +1,8 @@
|
||||
{{ if (and $.Site.Data.config.enableToc (ne .Params.enableToc false) (gt .WordCount 250)) }}
|
||||
<aside class="mainTOC">
|
||||
<details {{ if $.Site.Data.config.openToc }}open {{ end }}>
|
||||
<summary>Table of Contents</summary>
|
||||
{{ .TableOfContents }}
|
||||
</details>
|
||||
</aside>
|
||||
{{end}}
|
Loading…
Reference in New Issue
Block a user