Welcome to mirror list, hosted at ThFree Co, Russian Federation.

card-image.html « content « partials « layouts - github.com/h-enk/doks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c20f2dae5d97f50c5c89853b5e2dab698e3bb648 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{{ $fillImage := .Scratch.Get "fillImage" }}
{{ 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 -}}

{{ $image = $image.Fill $fillImage }}
{{ $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 }}">