mirror of
https://github.com/Crocmagnon/blog.git
synced 2024-12-22 13:52:01 +01:00
12 lines
584 B
HTML
12 lines
584 B
HTML
{{ $src := .Get "src" }}
|
|
{{ $origImage := .Page.Resources.GetMatch $src }}
|
|
{{ if eq $origImage.MediaType.SubType "svg" }}
|
|
<img src="{{ $origImage.RelPermalink }}" alt='{{ .Get "alt" }}'>
|
|
{{ else }}
|
|
{{ $resizeAdd := .Get "resizeAdd" | default "" }}
|
|
{{ $resize := printf "%s%s" (.Get "resize" | default "720x webp Lanczos ") $resizeAdd }}
|
|
{{ $image := $origImage.Resize $resize }}
|
|
<a href="{{ $origImage.RelPermalink }}">
|
|
<img src="{{ $image.RelPermalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}" alt='{{ .Get "alt" }}'>
|
|
</a>
|
|
{{ end }}
|