Replace some page config prefixes with nesting

This commit is contained in:
Will Faught
2023-01-28 19:32:21 -08:00
parent 388b7d757a
commit 2c4f4324ff
6 changed files with 94 additions and 62 deletions

View File

@@ -1,5 +1,9 @@
{{ $class := .Param "paige.page.content_class" }}
{{ $content := cond (.Scratch.Get "paige_show_full_pages" | not | not) .Content (.Content | replaceRE `(<h[1-6] id="([^"]+)".+)(</h[1-6]+>)` `${1}<a aria-label="Link to this section" class="paige-header-link" href="#${2}">#</a>${3}` | safeHTML) }}
{{ $class := .Param "paige.page.content.class" }}
{{ $content := "" }}
{{ if .Param "paige.page.title.hide" | not }}
{{ $content = cond (.Scratch.Get "paige_show_full_pages" | not | not) .Content (.Content | replaceRE `(<h[1-6] id="([^"]+)".+)(</h[1-6]+>)` `${1}<a aria-label="Link to this section" class="paige-header-link" href="#${2}">#</a>${3}` | safeHTML) }}
{{ end }}
{{ with $content }}
<section class="paige-content {{ with $class }} {{ . }} {{ end }}">