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

47 lines
1.8 KiB
HTML
Raw Normal View History

{{- $page := .page -}}
2023-10-08 17:38:54 +02:00
{{- $level := (.level | default 1) -}}
{{- $headingLink := (.headingLink | default false) -}}
{{- $showTags := not (.reduced | default false) -}}
{{- $showAuthors := not (.reduced | default false) -}}
{{ with $page }}
<header class="blog-header">
2023-11-04 22:26:11 +01:00
{{- if $headingLink }}<a href="{{ .RelPermalink }}">{{ end }}
2023-10-08 17:38:54 +02:00
<h{{ $level }}>{{ .Title }}</h{{ $level }}>
{{- if $headingLink }}</a>{{ end }}
{{- with .Params.subtitle }}
<span class="subtitle">{{ . }}</span>
{{- end }}
<div class="infos">
2023-10-08 17:38:54 +02:00
<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 }}
2023-10-08 17:38:54 +02:00
{{- if $showTags }}
{{- with .Page.GetTerms "tags" }}
<span class="li-space"><i class="fa-solid fa-tag"></i>
{{- range . }}
2023-11-04 22:26:11 +01:00
<span class="li-comma"><a href="{{ .RelPermalink }}">{{ .Title }}</a></span>
{{- end }}
</span>
{{- end }}
2023-10-08 17:38:54 +02:00
{{- end }}
{{- if $showAuthors }}
<br>
{{- with .Page.GetTerms "authors" }}
<span class="li-space"><i class="fa-regular fa-user"></i>
{{- range . }}
2023-11-04 22:26:11 +01:00
<span class="li-comma"><a href="{{ .RelPermalink }}">{{ .Title }}</a></span>
{{- end }}
</span>
{{- end }}
2023-10-08 17:38:54 +02:00
{{- end }}
</div>
{{- if isset .Params "header" }}
{{- $img := .Resources.GetMatch .Params.header.image }}
<img class="container" src="{{ $img.RelPermalink }}" alt="{{ .Params.header.caption }}" />
{{- end }}
</header>
2023-10-27 00:08:07 +02:00
{{- end }}