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.

40 lines
2.2 KiB
HTML

{{ $page := . }}
{{ $authors := cond ($page.Param "paige.page.authors.hide" | not) (partial "paige/func-authors.html" $page) "" }}
{{ $authorsclass := $page.Param "paige.page.authors.class" | default "text-center text-secondary" }}
{{ $categories := cond ($page.Param "paige.page.terms.show" | not) slice ($page.Params.categories | default slice) | sort | uniq }}
{{ $date := cond ($page.Param "paige.page.date.hide" | not) $page.PublishDate "" }}
{{ $dateclass := $page.Param "paige.page.date.class" | default "text-center text-secondary" }}
{{ $gap := "mb-0" }}
{{ $readingtime := $page.Param "paige.page.reading_time.show" }}
{{ $readingtimeclass := $page.Param "paige.page.reading_time.class" | default "text-center text-secondary" }}
{{ $tags := cond ($page.Param "paige.page.terms.show" | not) slice ($page.Params.tags | default slice) | sort | uniq }}
{{ $termsinnerclass := $page.Param "paige.page.terms.inner_class" | default "badge text-bg-secondary text-decoration-none" }}
{{ $termsouterclass := $page.Param "paige.page.terms.outer_class" | default "text-center" }}
{{ 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 class="{{ if or $date $readingtime }} {{ $gap }} {{ end }} {{ $authorsclass }}">{{ . }}</p>
{{ end }}
{{ with $date }}
<p class="{{ if $readingtime }} {{ $gap }} {{ end }} {{ $dateclass }}">
<time datetime="{{ .Format `2006-01-02` }}">{{ time.Format ($page.Param "paige.page.date.format" | default ":date_long") . }}</time>
</p>
{{ end }}
{{ if $readingtime }}
<p class="{{ $readingtimeclass }}">{{ $page.ReadingTime }} {{ i18n "paige_minutes" $page.ReadingTime }}</p>
{{ end }}