Assign template context to var
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
{{ $class := .Param "paige.page.content.class" }}
|
||||
{{ $page := . }}
|
||||
|
||||
{{ $class := $page.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) }}
|
||||
{{ if $page.Param "paige.page.title.hide" | not }}
|
||||
{{ $content = cond ($page.Scratch.Get "paige_show_full_pages" | not | not) $page.Content ($page.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 }}
|
||||
|
Reference in New Issue
Block a user