diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-06-14 16:44:29 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-06-14 16:44:29 +0200 |
| commit | b07d4ff0dfe2267013e3be729b58fb2a83c2deb8 (patch) | |
| tree | 447d336e4302205d0eb729f15ccddb9d224e127e /layouts/partials/single | |
| parent | 8a9ca0e0bac3284ecb8c028029380532a1978a9d (diff) | |
feat: Table of content
Diffstat (limited to 'layouts/partials/single')
| -rw-r--r-- | layouts/partials/single/default.html | 2 | ||||
| -rw-r--r-- | layouts/partials/single/table-of-contents.html | 17 |
2 files changed, 12 insertions, 7 deletions
diff --git a/layouts/partials/single/default.html b/layouts/partials/single/default.html index 25cda09..9b9b9c3 100644 --- a/layouts/partials/single/default.html +++ b/layouts/partials/single/default.html @@ -1,4 +1,4 @@ -<article class="flex flex-col gap-10"> +<article class="flex flex-col gap-4"> <header class="flex flex-col gap-2"> {{ partial "single/components/title/large" . }} <div class="text-sm font-semibold text-gray-500 flex gap-3"> diff --git a/layouts/partials/single/table-of-contents.html b/layouts/partials/single/table-of-contents.html index b8489bc..05689a1 100644 --- a/layouts/partials/single/table-of-contents.html +++ b/layouts/partials/single/table-of-contents.html @@ -1,6 +1,11 @@ -{{ if and .TableOfContents .Params.tableOfContents }} - <aside class="table-of-contents"> - <h2 class="title-small">{{ i18n "summary" }}</h2> - {{ .TableOfContents }} - </aside> -{{ end }}
\ No newline at end of file +{{ if and .TableOfContents (ne .Params.tableOfContents false) }} +<details class="table-of-contents"> + <summary class="toc-header"> + <span>On this page</span> + <svg class="toc-chevron" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> + <polyline points="4 6 8 10 12 6" /> + </svg> + </summary> + {{ .TableOfContents }} +</details> +{{ end }} |
