ccchh-website/themes/ccchh/layouts/partials/blog-header.html
2023-10-29 22:52:32 +01:00

43 lines
1.5 KiB
HTML

{{- $page := .page -}}
{{- $level := (.level | default 1) -}}
{{- $headingLink := (.headingLink | default false) -}}
{{- $showTags := not (.reduced | default false) -}}
{{- $showAuthors := not (.reduced | default false) -}}
{{ with $page }}
<header>
{{- if $headingLink }}<a href="{{ .Permalink }}">{{ end }}
<h{{ $level }}>{{ .Title }}</h{{ $level }}>
{{- if $headingLink }}</a>{{ end }}
{{- with .Params.subtitle }}
<span class="subtitle">{{ . }}</span>
{{- end }}
<div class="infos">
<span class="li-space"><i class="fa-solid fa-calendar-day"></i> {{ .Date | time.Format "Mon, 2006-01-02 15:04" }}</span>
{{- with .Params.location }}
<span class="li-space"><i class="fa-solid fa-location-dot"></i> {{ . }}</span>
{{- end }}
{{- if $showTags }}
{{- with .Page.GetTerms "tags" }}
<span class="li-space"><i class="fa-solid fa-tag"></i>
{{- range . }}
<span class="li-comma"><a href="{{ .Permalink }}">{{ .Title }}</a></span>
{{- end }}
</span>
{{- end }}
{{- end }}
{{- if $showAuthors }}
<br>
{{- with .Page.GetTerms "authors" }}
<span class="li-space"><i class="fa-regular fa-user"></i>
{{- range . }}
<span class="li-comma"><a href="{{ .Permalink }}">{{ .Title }}</a></span>
{{- end }}
</span>
{{- end }}
{{- end }}
</div>
</header>
{{- end }}