mirror of
https://github.com/Crocmagnon/blog.git
synced 2024-12-04 21:43:36 +01:00
14 lines
614 B
HTML
14 lines
614 B
HTML
{{ $src := .Get "src" }}
|
|
{{ $pageImage := .Page.Resources.Get $src }}
|
|
{{ $siteImage := resources.Get $src }}
|
|
{{ $origImage := $pageImage | default $siteImage }}
|
|
{{ 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 }}" alt='{{ .Get "alt" }}'>
|
|
</a>
|
|
{{ end }}
|