Assign template context to var

This commit is contained in:
Will Faught
2023-01-29 10:56:57 -08:00
parent 548af63634
commit 64e148ab6f
32 changed files with 262 additions and 199 deletions

View File

@@ -1,6 +1,8 @@
{{ $class := .Param "paige.page.title.class" | default "display-5 fw-bold text-center" }}
{{ $title := cond (.Param "paige.page.title.hide" | not) (.Title | markdownify) "" }}
{{ $page := . }}
{{ $class := $page.Param "paige.page.title.class" | default "display-5 fw-bold text-center" }}
{{ $title := cond ($page.Param "paige.page.title.hide" | not) ($page.Title | markdownify) "" }}
{{ if $title }}
<h1 class="{{ $class }}">{{ if .Params.link }}<a href="{{ .Params.link }}">{{ $title }}</a>{{ else }}{{ $title }}{{ end }}{{ if .Scratch.Get "paige_show_full_pages" }}<a aria-label="Link to this section" class="paige-header-link" href="{{ .RelPermalink }}">#</a>{{ end }}</h1>
<h1 class="{{ $class }}">{{ if $page.Params.link }}<a href="{{ .Params.link }}">{{ $title }}</a>{{ else }}{{ $title }}{{ end }}{{ if $page.Scratch.Get "paige_show_full_pages" }}<a aria-label="Link to this section" class="paige-header-link" href="{{ $page.RelPermalink }}">#</a>{{ end }}</h1>
{{ end }}