This commit is contained in:
Oliver
2025-06-23 09:42:07 -03:00
parent c352992708
commit cf823126d5
391 changed files with 13389 additions and 7731 deletions

View File

@@ -0,0 +1,56 @@
{{ $src := .src }} {{ $alt := .Text | default "image" }} {{ $title := .Title }}
{{ $isRemote := strings.HasPrefix $src "http" }} {{ if $isRemote }} {{ with
resources.GetRemote $src }} {{ if eq .MediaType.SubType "svg" }}
<img
src="{{ $src }}"
alt="{{ $alt }}"
{{
if
$title
}}title="{{ $title }}"
{{
end
}}
loading="lazy"
/>
{{ else }} {{ $webp := .Resize "300x300 webp" | fingerprint }}
<img
src="{{ $webp.RelPermalink }}"
alt="{{ $alt }}"
{{
if
$title
}}title="{{ $title }}"
{{
end
}}
loading="lazy"
/>
{{ end }} {{ end }} {{ else }} {{ with resources.Get $src }} {{ if eq
.MediaType.SubType "svg" }}
<img
src="{{ $src }}"
alt="{{ $alt }}"
{{
if
$title
}}title="{{ $title }}"
{{
end
}}
loading="lazy"
/>
{{ else }} {{ $resized := .Resize "300x300 webp" }}
<img
src="{{ $resized.RelPermalink }}"
alt="{{ $alt }}"
{{
if
$title
}}title="{{ $title }}"
{{
end
}}
loading="lazy"
/>
{{ end }} {{ end }} {{ end }}