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.
113 lines
5.9 KiB
HTML
113 lines
5.9 KiB
HTML
{{ $page := . }}
|
|
|
|
{{ $alert := $page.Param "paige.alert" | and ($page.Param "paige.page.disable_alert" | not) }}
|
|
{{ $authors := partial "paige/func-authors.html" $page | and ($page.Param "paige.page.disable_authors" | not) }}
|
|
{{ $categories := $page.GetTerms "categories" }}
|
|
{{ $date := and $page.IsPage $page.PublishDate | and ($page.Param "paige.page.disable_date" | not) }}
|
|
{{ $description := $page.Description | markdownify | and ($page.Param "paige.page.disable_description" | not) }}
|
|
{{ $first := templates.Exists "partials/paige/page-header-first.html" }}
|
|
{{ $format := $page.Param "paige.date_format" | default ":date_long" }}
|
|
{{ $last := templates.Exists "partials/paige/page-header-last.html" }}
|
|
{{ $link := $page.Params.link }}
|
|
{{ $microdata := $page.Params.paige.page.microdata }}
|
|
{{ $normal := eq ($page.Param "paige.keyword_style" | default "text") "text" }}
|
|
{{ $series := $page.GetTerms "series" | and ($page.Param "paige.page.disable_series" | not) }}
|
|
{{ $tags := $page.GetTerms "tags" }}
|
|
{{ $time := $page.ReadingTime | and ($page.Param "paige.page.disable_reading_time" | not) }}
|
|
{{ $title := $page.LinkTitle | markdownify | and ($page.Param "paige.page.disable_title" | not) }}
|
|
{{ $toc := and $page.Content (ne $page.TableOfContents `<nav id="TableOfContents"></nav>`) | and ($page.Param "paige.page.disable_toc" | not) }}
|
|
|
|
{{ $keywords := sort (append $categories $tags) "LinkTitle" | and ($page.Param "paige.page.disable_keywords" | not) }}
|
|
|
|
{{ if or $alert $authors $date $description $first $keywords $last $time $series $title $toc }}
|
|
<header class="mw-100" id="paige-page-header">
|
|
<div class="align-items-center d-flex flex-column">
|
|
{{ if $first }}
|
|
{{ partial "paige/page-header-first.html" . }}
|
|
{{ end }}
|
|
|
|
{{ with $title }}
|
|
<h1 class="fw-bold" id="paige-page-title" {{ if $microdata }} itemprop="headline name" {{ end }}>{{ if $link }}<a href="{{ $link }}">{{ . }}</a>{{ else }}{{ . }}{{ end }}</h1>
|
|
{{ end }}
|
|
|
|
{{ with $description }}
|
|
<p class="lead paige-row-wide" id="paige-page-description" {{ if $microdata }} itemprop="alternativeHeadline description" {{ end }}>{{ . }}</p>
|
|
{{ end }}
|
|
|
|
{{ if or $authors $date $keywords $time $series }}
|
|
<div id="paige-metadata">
|
|
{{ with $keywords }}
|
|
<p class="{{ if $normal }} paige-row-narrow {{ end }} text-center {{ if $normal }} text-secondary {{ end }}" id="paige-keywords">
|
|
{{ range $i, $term := . -}}
|
|
{{- $kind := false -}}
|
|
|
|
{{- if in $categories $term -}}
|
|
{{- $kind = "category" -}}
|
|
{{- else -}}
|
|
{{- $kind = "tag" -}}
|
|
{{- end -}}
|
|
|
|
{{- if $normal -}}
|
|
{{- if gt $i 0 }} · {{ end -}}
|
|
|
|
<a class="link-secondary paige-keyword paige-keyword-{{ $kind }}" href="{{ .RelPermalink | safeURL }}" {{ if $microdata }} itemprop="keywords" {{ end }}>{{ .LinkTitle }}</a>
|
|
{{- else -}}
|
|
{{- if gt $i 0 }} {{ end -}}
|
|
|
|
<a class="badge paige-keyword paige-keyword-{{ $kind }} text-bg-secondary text-decoration-none" href="{{ .RelPermalink | safeURL }}" {{ if $microdata }} itemprop="keywords" {{ end }}>{{ .LinkTitle }}</a>
|
|
{{- end -}}
|
|
{{- end }}
|
|
</p>
|
|
{{ end }}
|
|
|
|
{{ with $series }}
|
|
<p class="paige-row-narrow text-center text-secondary" id="paige-series">
|
|
{{ range $i, $series := . -}}
|
|
{{- if gt $i 0 }} · {{ end -}}
|
|
|
|
<a class="link-secondary" href="{{ .RelPermalink }}" {{ if $microdata }} itemprop="isPartOf" {{ end }}>{{ .LinkTitle }}</a>
|
|
{{- end }}
|
|
</p>
|
|
{{ end }}
|
|
|
|
{{ with $authors }}
|
|
<p class="paige-row-narrow text-center text-secondary" id="paige-authors">
|
|
{{ range $i, $author := . -}}
|
|
{{- if gt $i 0 }} · {{ end -}}
|
|
|
|
<a class="link-secondary" href="{{ .RelPermalink }}" {{ if $microdata }} itemprop="author" {{ end }}>{{ .LinkTitle }}</a>
|
|
{{- end }}
|
|
</p>
|
|
{{ end }}
|
|
|
|
{{ with $date }}
|
|
<p class="paige-row-narrow text-center text-secondary" id="paige-date">
|
|
<time datetime="{{ .Format `2006-01-02` }}" {{ if $microdata }} itemprop="datePublished" {{ end }}>{{ time.Format $format . }}</time>
|
|
</p>
|
|
{{ end }}
|
|
|
|
{{ with $time }}
|
|
<p class="paige-row-narrow text-center text-secondary" id="paige-reading-time" {{ if $microdata }} itemprop="timeRequired" {{ end }}>{{ . }} {{ i18n "paige_minutes" . }}</p>
|
|
{{ end }}
|
|
</div>
|
|
{{ end }}
|
|
|
|
{{ with $alert }}
|
|
<div class="alert alert-{{ .type }} paige-row-wide" id="paige-alert" role="alert">{{ .message | markdownify }}</div>
|
|
{{ end }}
|
|
|
|
{{ if $toc }}
|
|
<div class="paige-row-wide" id="paige-toc">
|
|
<div class="border pe-3 ps-3 pt-3 rounded">
|
|
{{ $page.TableOfContents }}
|
|
</div>
|
|
</div>
|
|
{{ end }}
|
|
|
|
{{ if $last }}
|
|
{{ partial "paige/page-header-last.html" . }}
|
|
{{ end }}
|
|
</div>
|
|
</header>
|
|
{{ end }}
|