1
Fork 0
theorangeone.net-legacy/layouts/_default/_markup/render-image.html
Jake Howard cd83cbf332
Replace cusotm image loader with object-fit CSS
Because of this, images had to be changed to load async, else pages are crazy intensive to load
2021-07-18 12:36:59 +01:00

16 lines
571 B
HTML

{{ $destination := .Destination }}
{{ $resource := .Page.Resources.GetMatch $destination }}
{{ if $resource }}
{{ $destination = ($resource.Resize "1500x").RelPermalink }}
{{ end }}
<figure class="text-center">
<a href="{{ $destination | safeURL }}" target="_blank">
<img src="{{ $destination | safeURL }}" alt="{{ .Text | plainify }}" style='max-width: {{ default "90" .Title }}%;' referrerpolicy="no-referrer" loading="lazy" decoding="async" />
</a>
<figcaption class="text-center">
<small>{{ .Text | markdownify }}</small>
</figcaption>
</figure>