Hugo-theme-stack/layouts/partials/article-list/default.html
2020-09-06 19:51:16 +02:00

18 lines
719 B
HTML

<article class="{{ if .Params.image }}has-image{{ end }}">
{{ if .Params.image }}
{{- $image := partial "helper/image" . -}}
{{- $thumbnail := $image.Fill "800x250" -}}
{{- $thumbnailRetina := $image.Fill "1600x500" -}}
<div class="article-image">
<a href="{{ .Permalink }}">
<img src="{{ $thumbnail.RelPermalink }}"
srcset="{{ $thumbnail.RelPermalink }} 1x, {{ $thumbnailRetina.RelPermalink }} 2x"
width="{{ $thumbnail.Width }}" height="{{ $thumbnail.Height }}" loading="lazy"
alt="Featured image of post {{ .Title }}" />
</a>
</div>
{{ end }}
{{ partial "article/components/details" . }}
</article>