You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.8 KiB
HTML
55 lines
1.8 KiB
HTML
{{ $page := . }}
|
|
|
|
{{ $class := slice "align-items-center" "d-flex" "flex-column" "my-3" }}
|
|
{{ $content := $page.Content | replaceRE `(<h[1-6] id="([^"]+)".+)(</h[1-6]+>)` (printf `${1}<a aria-label="%s" class="paige-header-link" href="#${2}"></a>${3}` (i18n "paige_aria_section_link")) }}
|
|
{{ $draft := $page.Draft }}
|
|
{{ $expired := and $page.ExpiryDate (lt $page.ExpiryDate now) }}
|
|
{{ $future := and $page.PublishDate (gt $page.PublishDate now) }}
|
|
{{ $modified := and $page.PublishDate $page.Lastmod (lt $page.PublishDate $page.Lastmod) }}
|
|
|
|
{{ if $draft }}
|
|
{{ $class = $class | append "paige-draft" "paige-unpublished" }}
|
|
{{ end }}
|
|
|
|
{{ if $expired }}
|
|
{{ $class = $class | append "paige-expired" "paige-unpublished" }}
|
|
{{ end }}
|
|
|
|
{{ if $future }}
|
|
{{ $class = $class | append "paige-future" "paige-unpublished" }}
|
|
{{ end }}
|
|
|
|
{{ if $modified }}
|
|
{{ $class = $class | append "paige-modified" }}
|
|
{{ end }}
|
|
|
|
{{ if not (or $draft $expired $future) }}
|
|
{{ $class = $class | append "paige-published" }}
|
|
{{ end }}
|
|
|
|
{{ with $page.Kind }}
|
|
{{ if eq . "home" }}
|
|
{{ $class = $class | append "paige-home" }}
|
|
{{ else if eq . "section" }}
|
|
{{ $class = $class | append "paige-list" }}
|
|
{{ else if eq . "page" }}
|
|
{{ $class = $class | append "paige-single" }}
|
|
{{ else if eq . "taxonomy" }}
|
|
{{ $class = $class | append "paige-taxonomy" }}
|
|
{{ else if eq . "term" }}
|
|
{{ $class = $class | append "paige-term" }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ $class = delimit ($class | uniq) " " }}
|
|
|
|
<article class="{{ $class }}" id="paige-article">
|
|
{{ partial "paige/page-header.html" $page }}
|
|
|
|
{{ with $content }}
|
|
<div class="mw-100" id="paige-content">{{ . | safeHTML }}</div>
|
|
{{ end }}
|
|
|
|
{{ partial "paige/page-footer.html" $page }}
|
|
</article>
|