Make table of contents collapsible

This commit is contained in:
BBaoVanC 2021-10-26 20:50:45 -05:00
parent a1fae8aa60
commit 0cfecdab18
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A
2 changed files with 12 additions and 6 deletions

View File

@ -62,8 +62,14 @@
/* Content formatting */
#table-of-contents h2 {
font-size: 20px;
#table-of-contents {
background-color: #222;
padding: 8px 20px;
border-radius: 5px;
}
#table-of-contents summary {
cursor: pointer;
}
.content, footer {

View File

@ -10,13 +10,13 @@
{{ if .Params.Toc }}
<div id="table-of-contents">
<h2>{{ i18n "table_of_contents" }}</h2>
{{ .TableOfContents }}
<details>
<summary>{{ i18n "table_of_contents" }}</summary>
{{ .TableOfContents }}
</details>
</div>
{{ end }}
<hr>
{{ with .Resources.GetMatch "feature" }}
<div class="post-media">
{{ partial "figure.html" . }}