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.

89 lines
4.9 KiB
HTML

{{ $params := . }}
{{ $page := . }}
{{ $listshowcontent := false }}
{{ if reflect.IsMap $params }}
{{ $page = $params.page }}
{{ $listshowcontent = $params.listshowcontent }}
{{ end }}
{{ $authors := cond ($page.Param "paige.main.metadata.authors.hide" | not) (partial "paige/func-authors.html" $page) "" }}
{{ $authorsclass := $page.Param "paige.main.metadata.authors.class" | default "paige-authors text-center text-secondary" }}
{{ $categories := cond ($page.Param "paige.main.metadata.terms.hide" | not) ($page.Params.categories | default slice) slice | uniq }}
{{ $commiturl := "" }}
{{ $date := cond ($page.Param "paige.main.metadata.date.hide" | not) $page.PublishDate "" }}
{{ $dateclass := $page.Param "paige.main.metadata.date.class" | default "paige-date text-center text-secondary" }}
{{ $dateformat := $page.Param "paige.main.metadata.date.format" | default ":date_long" }}
{{ $description := cond ($page.Param "paige.main.metadata.description.hide" | not) ($page.Description | markdownify) "" }}
{{ $descriptionclass := $page.Param "paige.main.metadata.description.class" | default "lead paige-description text-center" }}
{{ $lastmod := cond (eq $date $page.Lastmod) "" $page.Lastmod }}
{{ $lastmodshow := and $lastmod ($page.Param "paige.main.metadata.date.lastmod.hide" | not) }}
{{ $nogap := "mb-0" }}
{{ $readingtime := cond ($page.Param "paige.main.metadata.reading_time.hide" | not) $page.ReadingTime "" }}
{{ $readingtimeclass := $page.Param "paige.main.metadata.reading_time.class" | default "paige-reading-time text-center text-secondary" }}
{{ $sectionclass := "paige-metadata w-100" }}
{{ $tags := cond ($page.Param "paige.main.metadata.terms.hide" | not) ($page.Params.tags | default slice) slice | uniq }}
{{ $termsinnerclass := $page.Param "paige.main.metadata.terms.inner_class" | default "badge paige-terms-inner text-bg-secondary text-decoration-none" }}
{{ $termsouterclass := $page.Param "paige.main.metadata.terms.outer_class" | default "paige-terms-outer text-center" }}
{{ $title := cond ($page.Param "paige.main.metadata.title.hide" | not) ($page.Title | markdownify) "" }}
{{ $titleclass := $page.Param "paige.main.metadata.title.class" | default "display-5 fw-bold paige-title text-center" }}
{{ $titlelink := $page.Params.link }}
{{ $titlepage := $page.RelPermalink }}
{{ if and ($page.Param "paige.main.metadata.git.commit_url_prefix") $page.GitInfo }}
{{ $commiturl = print ($page.Param "paige.main.metadata.git.commit_url_prefix") $page.GitInfo.Hash }}
{{ end }}
<section {{ with $sectionclass }} class="{{ . }}" {{ end }}>
{{ with $title }}
<h1 {{ with $titleclass }} class="{{ . }}" {{ end }}>{{ with $titlelink }}<a href="{{ . }}">{{ . }}</a>{{ else }}{{ . }}{{ end }}{{ if $listshowcontent }}<a aria-label="{{ i18n `paige_aria_page_link` }}" class="paige-header-link" href="{{ $titlepage }}">#</a>{{ end }}</h1>
{{ end }}
{{ with $description }}
<p {{ with $descriptionclass }} class="{{ . }}" {{ end }}>{{ . }}</p>
{{ end }}
{{ if or $categories $tags }}
<p {{ with $termsouterclass }} class="{{ . }}" {{ end }}>
{{ $terms := slice }}
{{ range $categories }}
{{ $terms = $terms | append (dict "name" . "url" (lower . | printf "categories/%v/" | relLangURL)) }}
{{ end }}
{{ range $tags }}
{{ $terms = $terms | append (dict "name" . "url" (lower . | printf "tags/%v/" | relLangURL)) }}
{{ end }}
{{ range sort $terms "name" }}
<a {{ with $termsinnerclass }} class="{{ . }}" {{ end }} href="{{ .url | safeURL }}">{{ .name }}</a>
{{ end }}
</p>
{{ end }}
{{ with $authors }}
<p {{ if or $authorsclass $date $readingtime }} class="{{ if or $date $readingtime }} {{ $nogap }} {{ end }} {{ with $authorsclass }} {{ . }} {{ end }}" {{ end }}>{{ . }}</p>
{{ end }}
{{ with $date }}
<p {{ if or $dateclass $readingtime }} class="{{ if $readingtime }} {{ $nogap }} {{ end }} {{ with $dateclass }} {{ . }} {{ end }}" {{ end }}>
{{ if $lastmodshow }}
<time datetime="{{ .Format `2006-01-02` }}">{{ time.Format $dateformat . }}</time> &middot; {{ with $commiturl }} <a class="link-secondary text-decoration-none" href="{{ . }}"> {{ end }} <time datetime="{{ .Format `2006-01-02` }}">{{ time.Format $dateformat $lastmod }}</time> {{ if $commiturl }} </a> {{ end }}
{{ else }}
{{ with $commiturl }}
<a class="link-secondary text-decoration-none" href="{{ . }}">
{{ end }}
<time datetime="{{ .Format `2006-01-02` }}">{{ time.Format $dateformat . }}</time>
{{ if $commiturl }}
</a>
{{ end }}
{{ end }}
</p>
{{ end }}
{{ with $readingtime }}
<p {{ with $readingtimeclass }} class="{{ . }}" {{ end }}>{{ . }} {{ i18n "paige_minutes" . }}</p>
{{ end }}
</section>