Improve rendering of TOC items

The table of contents now support headings generated by shortcodes. Be sure to include an `id` if your custom partials or shortcodes include HTML headings (h1-h6). To exclude these headings from the TOC, use the attribute `fs-` to define a font size.
This commit is contained in:
Mark Dumay
2025-01-16 14:42:23 +01:00
parent 2e8b087c48
commit d28b51aa63
10 changed files with 278 additions and 41 deletions

View File

@@ -75,6 +75,38 @@
}
}
a.toc-item {
display: block;
}
a.toc-level-1 {
margin-left: 0em;
}
a.toc-level-2 {
margin-left: 1em;
}
a.toc-level-3 {
margin-left: 2em;
}
a.toc-level-4 {
margin-left: 3em;
}
a.toc-level-5 {
margin-left: 4em;
}
a.toc-level-6 {
margin-left: 5em;
}
.toc nav {
margin-bottom: 0;
}
@if $enable-dark-mode {
[data-bs-theme="dark"] {
.toc-button {