Hugo-theme-stack/layouts/partials/article/components/header.html
2020-08-29 11:34:26 +02:00

17 lines
591 B
HTML

<header class="article-header">
{{ if .Params.image }}
{{- $image := partial "helper/image" . -}}
{{- $tablet := $image.Resize "1024x" -}}
{{- $desktop := $image.Resize "2000x" -}}
<div class="article-image">
<img srcset="{{ $tablet.RelPermalink }} 1024w, {{ $desktop.RelPermalink }} 2000w"
src="{{ $desktop.RelPermalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}"
loading="lazy"
alt="Featured image of post {{ .Title }}" />
</div>
{{ end }}
{{ partial "article/components/details" . }}
</header>