Add paige.main.table_of_contents.class param

This commit is contained in:
Will Faught
2023-02-05 19:54:28 -08:00
parent 469d6ee893
commit 10f005e6cb
2 changed files with 12 additions and 3 deletions

View File

@@ -323,6 +323,7 @@ paige:
class: "display-5 fw-bold text-center" # Default is "display-5 fw-bold text-center"
hide: false # Default is false
table_of_contents:
class: "border mb-3 pe-3 ps-3 pt-3 rounded" # Default is "border mb-3 pe-3 ps-3 pt-3 rounded"
hide: false # Default is false
max_width: "66ch" # Default is ""
content:

View File

@@ -1,9 +1,17 @@
{{ $page := . }}
{{ $class := $page.Param "paige.main.table_of_contents.class" | default "border mb-3 pe-3 ps-3 pt-3 rounded" }}
{{ if and $page.Content ($page.Param "paige.main.table_of_contents.hide" | not) (not (eq ($page.Scratch.Get "paige_list_show_content") true)) (ne $page.TableOfContents `<nav id="TableOfContents"></nav>`) }}
<section class="paige-toc">
<div class="border mb-3 pe-3 ps-3 pt-3 rounded">
{{ $page.TableOfContents }}
</div>
{{ with $class }}
<div class="{{ . }}">
{{ end }}
{{ $page.TableOfContents }}
{{ if $class }}
</div>
{{ end }}
</section>
{{ end }}