itsdrike.com/layouts/_default/_markup/render-image.html

16 lines
511 B
HTML
Raw Normal View History

2022-04-18 08:51:44 +00:00
{{ $destination := .Destination }}
{{ $resource := .Page.Resources.GetMatch $destination }}
{{ if $resource }}
2022-05-11 12:10:49 +00:00
{{ $destination = ($resource.Resize "1500x webp").RelPermalink }}
2022-04-18 08:51:44 +00:00
{{ end }}
<figure class="text-center">
2022-05-11 12:10:49 +00:00
<img src="{{ $destination | safeURL }}" alt="{{ .Text | plainify }}" style='max-width: {{ default "90" .Title }}%;'
referrerpolicy="no-referrer" loading="lazy" decoding="async" />
<figcaption class="text-center">
<small>{{ .Text }}</small>
</figcaption>
2022-04-18 08:51:44 +00:00
</figure>