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.

78 lines
3.1 KiB
HTML

{{ $params := . }}
{{ $page := . }}
{{ $listshowcontent := false }}
{{ if reflect.IsMap $params }}
{{ $page = $params.page }}
{{ $listshowcontent = $params.listshowcontent }}
{{ end }}
{{ $authors := partial "paige/authors.html" $page }}
{{ $categories := $page.Params.categories | default slice | uniq }}
{{ $commiturl := "" }}
{{ $date := cond (eq ($page.Param "paige.date.source" | default "published") "published") $page.PublishDate $page.Lastmod }}
{{ $dateformat := $page.Param "paige.date.format" | default ":date_long" }}
{{ $description := $page.Description | markdownify }}
{{ $nogap := "mb-0" }}
{{ $readingtime := cond ($page.Param "paige.reading_time.hide" | not) $page.ReadingTime "" }}
{{ $readingtimeclass := $page.Param "paige.reading_time.class" | default "paige-reading-time text-center text-secondary" }}
{{ $tags := $page.Params.tags | default slice | uniq }}
{{ $title := $page.Title | markdownify }}
{{ $titlelink := $page.Params.link }}
{{ $titlepage := $page.RelPermalink }}
{{ if and ($page.Param "paige.git.commit_url_prefix") $page.GitInfo }}
{{ $commiturl = print ($page.Param "paige.git.commit_url_prefix") $page.GitInfo.Hash }}
{{ end }}
<section class="paige-metadata w-100">
{{ with $title }}
<h1 class="display-5 fw-bold paige-title text-center">{{ 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 class="lead paige-description text-center">{{ . }}</p>
{{ end }}
{{ if or $categories $tags }}
<p class="paige-terms-outer text-center">
{{ $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 class="badge paige-terms-inner text-bg-secondary text-decoration-none" href="{{ .url | safeURL }}">{{ .name }}</a>
{{ end }}
</p>
{{ end }}
{{ with $authors }}
<p class="{{ if or $date $readingtime }} {{ $nogap }} {{ end }} paige-authors text-center text-secondary">{{ . }}</p>
{{ end }}
{{ with $date }}
<p class="{{ if $readingtime }} {{ $nogap }} {{ end }} paige-date text-center text-secondary">
{{ 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 }}
</p>
{{ end }}
{{ with $readingtime }}
<p {{ with $readingtimeclass }} class="{{ . }}" {{ end }}>{{ . }} {{ i18n "paige_minutes" . }}</p>
{{ end }}
</section>