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 */ /* Content formatting */
#table-of-contents h2 { #table-of-contents {
font-size: 20px; background-color: #222;
padding: 8px 20px;
border-radius: 5px;
}
#table-of-contents summary {
cursor: pointer;
} }
.content, footer { .content, footer {

View File

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