mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-26 05:19:01 +00:00
feat: hide toc for short notes
This commit is contained in:
parent
fc4b9ded76
commit
e245505082
3 changed files with 10 additions and 16 deletions
|
@ -22,14 +22,7 @@
|
||||||
<li><a href="{{ .Permalink }}">{{ .LinkTitle | humanize }}</a></li>
|
<li><a href="{{ .Permalink }}">{{ .LinkTitle | humanize }}</a></li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
{{ if (and $.Site.Data.config.enableToc (ne .Params.enableToc false)) }}
|
{{partial "toc.html" .}}
|
||||||
<aside class="mainTOC">
|
|
||||||
<details {{ if $.Site.Data.config.openToc }}open {{ end }}>
|
|
||||||
<summary>Table of Contents</summary>
|
|
||||||
{{ .TableOfContents }}
|
|
||||||
</details>
|
|
||||||
</aside>
|
|
||||||
{{end}}
|
|
||||||
{{partial "textprocessing.html" . }}
|
{{partial "textprocessing.html" . }}
|
||||||
</article>
|
</article>
|
||||||
{{partial "footer.html" .}}
|
{{partial "footer.html" .}}
|
||||||
|
|
|
@ -13,14 +13,7 @@
|
||||||
{{partial "darkmode.html" .}}
|
{{partial "darkmode.html" .}}
|
||||||
</header>
|
</header>
|
||||||
<article>
|
<article>
|
||||||
{{ if (and $.Site.Data.config.enableToc (ne .Params.enableToc false)) }}
|
{{partial "toc.html" .}}
|
||||||
<aside class="mainTOC">
|
|
||||||
<details {{ if $.Site.Data.config.openToc }}open {{ end }}>
|
|
||||||
<summary>Table of Contents</summary>
|
|
||||||
{{ .TableOfContents }}
|
|
||||||
</details>
|
|
||||||
</aside>
|
|
||||||
{{end}}
|
|
||||||
{{partial "textprocessing.html" . }}
|
{{partial "textprocessing.html" . }}
|
||||||
</article>
|
</article>
|
||||||
{{partial "footer.html" .}}
|
{{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 a new issue