hugo-theme-stack/layouts/partials/article/components/header.html

17 lines
591 B
HTML
Raw Normal View History

<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>