Replace scratch with param

This commit is contained in:
Will Faught
2023-02-12 17:23:11 -08:00
parent c47d3be282
commit 9e484bc707
5 changed files with 41 additions and 8 deletions

View File

@@ -1,8 +1,16 @@
{{ $params := . }}
{{ $page := . }}
{{ $listshowcontent := false }}
{{ if reflect.IsMap $params }}
{{ $page = $params.page }}
{{ $listshowcontent = $params.listshowcontent }}
{{ end }}
{{ $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>`) }}
{{ if and $page.Content ($page.Param "paige.main.table_of_contents.hide" | not) (not $listshowcontent) (ne $page.TableOfContents `<nav id="TableOfContents"></nav>`) }}
<section class="paige-toc">
{{ with $class }}
<div class="{{ . }}">