2023-05-21 11:33:01 +02:00
|
|
|
{{ $src := .Get "src" }}
|
2023-05-21 23:15:04 +02:00
|
|
|
{{ $pageImage := .Page.Resources.Get $src }}
|
|
|
|
{{ $siteImage := resources.Get $src }}
|
|
|
|
{{ $origImage := $pageImage | default $siteImage }}
|
2023-05-21 11:33:01 +02:00
|
|
|
{{ if eq $origImage.MediaType.SubType "svg" }}
|
2023-05-21 18:38:23 +02:00
|
|
|
<img src="{{ $origImage.RelPermalink }}" alt='{{ .Get "alt" }}'>
|
2023-05-21 11:33:01 +02:00
|
|
|
{{ else }}
|
2023-05-21 11:51:25 +02:00
|
|
|
{{ $resizeAdd := .Get "resizeAdd" | default "" }}
|
|
|
|
{{ $resize := printf "%s%s" (.Get "resize" | default "720x webp Lanczos ") $resizeAdd }}
|
|
|
|
{{ $image := $origImage.Resize $resize }}
|
2023-05-21 11:33:01 +02:00
|
|
|
<a href="{{ $origImage.RelPermalink }}">
|
2023-05-21 23:37:30 +02:00
|
|
|
<img src="{{ $image.RelPermalink }}" alt='{{ .Get "alt" }}'>
|
2023-05-21 11:33:01 +02:00
|
|
|
</a>
|
|
|
|
{{ end }}
|