feat(article list/default): better thumbnail
This commit is contained in:
parent
2ab49f97ee
commit
7f3d906f24
@ -1,12 +1,14 @@
|
|||||||
<article class="{{ if .Params.image }}has-image{{ end }}">
|
<article class="{{ if .Params.image }}has-image{{ end }}">
|
||||||
{{ if .Params.image }}
|
{{ if .Params.image }}
|
||||||
{{- $image := partial "helper/image" . -}}
|
{{- $image := partial "helper/image" . -}}
|
||||||
{{- $thumbnailNotDesktop := $image.Resize "x500 smart" -}}
|
{{- $thumbnail := $image.Fill "800x250" -}}
|
||||||
|
{{- $thumbnailRetina := $image.Fill "1600x500" -}}
|
||||||
|
|
||||||
<div class="article-image">
|
<div class="article-image">
|
||||||
<a href="{{ .Permalink }}">
|
<a href="{{ .Permalink }}">
|
||||||
<img src="{{ $thumbnailNotDesktop.RelPermalink }}"
|
<img src="{{ $thumbnail.RelPermalink }}"
|
||||||
width="{{ $thumbnailNotDesktop.Width }}" height="{{ $thumbnailNotDesktop.Height }}" loading="lazy"
|
srcset="{{ $thumbnail.RelPermalink }} 1x, {{ $thumbnailRetina.RelPermalink }} 2x"
|
||||||
|
width="{{ $thumbnail.Width }}" height="{{ $thumbnail.Height }}" loading="lazy"
|
||||||
alt="Featured image of post {{ .Title }}" />
|
alt="Featured image of post {{ .Title }}" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user