ccchh-website/themes/ccchh/layouts/partials/blog-header.html

47 lines
1.8 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 class="blog-header">
{{- if $headingLink }}<a href="{{ .RelPermalink }}">{{ 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="{{ .RelPermalink }}">{{ .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="{{ .RelPermalink }}">{{ .Title }}</a></span>
{{- end }}
</span>
{{- end }}
{{- end }}
</div>
{{- if isset .Params "header" }}
{{- $img := .Resources.GetMatch .Params.header.image }}
<img class="container" src="{{ $img.RelPermalink }}" alt="{{ .Params.header.caption }}" />
{{- end }}
</header>
{{- end }}