aboutsummaryrefslogtreecommitdiffstats
path: root/code/frontpage/layouts/partials/content/card-image.html
blob: 51a5e518ed38409bdd58e35bbc7d51dd7603cfdb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{{ $fillImage := .Scratch.Get "fillImageCard" }}
{{ if not $fillImage -}}
{{ $fillImage = site.Params.fillImage }}
{{ end -}}

{{ $image := .Resources.GetMatch (printf "**%s" (index .Params.images 0)) }}
{{ if not $image -}}
{{ $image = resources.Get (printf "%s%s" "images/" site.Params.defaultImage) }}
{{ end -}}

{{ $webp := printf "%s%s" $fillImage " webp" }}
{{/* {{ $image = $image.Resize $webp}} */}}

{{ $lqip := $image.Resize site.Params.lqipWidth -}}

<img class="card-img-top img-fluid lazyload blur-up" src="{{ $lqip.Permalink }}" data-src="{{ $image.Permalink }}"
  width="{{ $image.Width }}" height="{{ $image.Height }}" alt="{{ .Title }}">