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 }}">
|
||||
{{ if .Params.image }}
|
||||
{{- $image := partial "helper/image" . -}}
|
||||
{{- $thumbnailNotDesktop := $image.Resize "x500 smart" -}}
|
||||
{{- $thumbnail := $image.Fill "800x250" -}}
|
||||
{{- $thumbnailRetina := $image.Fill "1600x500" -}}
|
||||
|
||||
<div class="article-image">
|
||||
<a href="{{ .Permalink }}">
|
||||
<img src="{{ $thumbnailNotDesktop.RelPermalink }}"
|
||||
width="{{ $thumbnailNotDesktop.Width }}" height="{{ $thumbnailNotDesktop.Height }}" loading="lazy"
|
||||
<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>
|
||||
|
Loading…
Reference in New Issue
Block a user