mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-14 22:16:58 +00:00
feat(shortcode): make in-page ToC collapsable
Useful for long pages with large ToCs and/or on small screens.
Also add `hide_on` and `show_on` options accepting Bootstrap responsive breakpoints.
Useful for setting `{{< toc hide_on="xl" >}}` in conjunction with Book layout which only shows right sidebar ToC on XL screens and above.
This commit is contained in:
1 parent
a4bc42feb6
commit
468d327370
1 file changed
+4
-2
@@ -1,2 +1,4 @@
|
||||
<h2>{{ i18n "table_of_contents" }}</h2>
|
||||
{{ $.Page.TableOfContents }}
|
||||
<details class="toc-inpage d-print-none {{with .Get "hide_on"}}d-{{.}}-none{{end}} {{with .Get "show_on"}}d-none d-{{.}}-block{{end}}" open>
|
||||
<summary class="font-weight-bold">{{ i18n "table_of_contents" }}</summary>
|
||||
{{ $.Page.TableOfContents }}
|
||||
</details>
|
||||
Reference in new issue
Block a user