2020-08-24 13:27:51 -04:00
|
|
|
<header class="article-header">
|
2020-09-17 18:12:26 -04:00
|
|
|
{{- $image := partialCached "helper/image" (dict "Context" . "Type" "article") .RelPermalink "article" -}}
|
2020-09-10 12:53:36 -04:00
|
|
|
{{ if $image.exists }}
|
|
|
|
<div class="article-image">
|
2020-12-23 15:02:35 -05:00
|
|
|
<a href="{{ .RelPermalink }}">
|
|
|
|
{{ if $image.resource }}
|
|
|
|
{{- $Permalink := $image.resource.RelPermalink -}}
|
|
|
|
{{- $Width := $image.resource.Width -}}
|
|
|
|
{{- $Height := $image.resource.Height -}}
|
|
|
|
{{- $Srcset := "" -}}
|
|
|
|
|
2022-10-29 11:14:19 -04:00
|
|
|
{{- if (default true .Page.Site.Params.imageProcessing.cover.enabled) -}}
|
2020-12-23 15:02:35 -05:00
|
|
|
{{- $thumbnail := $image.resource.Resize "800x" -}}
|
|
|
|
{{- $thumbnailRetina := $image.resource.Resize "1600x" -}}
|
|
|
|
{{- $Srcset = printf "%s 800w, %s 1600w" $thumbnail.RelPermalink $thumbnailRetina.RelPermalink -}}
|
|
|
|
{{- $Permalink = $thumbnail.RelPermalink -}}
|
|
|
|
{{- $Width = $thumbnail.Width -}}
|
|
|
|
{{- $Height = $thumbnail.Height -}}
|
|
|
|
{{- end -}}
|
2020-08-24 13:27:51 -04:00
|
|
|
|
2020-12-23 15:02:35 -05:00
|
|
|
<img src="{{ $Permalink }}"
|
|
|
|
{{ with $Srcset }}srcset="{{ . }}"{{ end }}
|
|
|
|
width="{{ $Width }}"
|
|
|
|
height="{{ $Height }}"
|
|
|
|
loading="lazy"
|
|
|
|
alt="Featured image of post {{ .Title }}" />
|
|
|
|
{{ else }}
|
|
|
|
<img src="{{ $image.permalink }}" loading="lazy" alt="Featured image of post {{ .Title }}" />
|
|
|
|
{{ end }}
|
|
|
|
</a>
|
2020-09-10 12:53:36 -04:00
|
|
|
</div>
|
2020-08-24 13:27:51 -04:00
|
|
|
{{ end }}
|
|
|
|
|
2020-09-17 17:13:50 -04:00
|
|
|
{{ partialCached "article/components/details" . .RelPermalink }}
|
2020-08-24 13:27:51 -04:00
|
|
|
</header>
|