added lqip to picture

pull/647/head
stereobooster 2023-09-13 08:48:48 +02:00
parent 9b64aa8c30
commit 8989f5186a
1 changed files with 9 additions and 1 deletions

View File

@ -22,7 +22,15 @@
{{ $resource = resources.Get ($url.String) }}
{{ end }}
{{ with $resource }}
<picture>
{{ if ne .MediaType.SubType "svg" }}
{{ $lqip := (.Resize "20x webp").Content | base64Encode }}
<picture
style="background: url(data:image/webp;base64,{{ $lqip }}); background-size: cover"
class="{{ $class }}"
>
{{ else }}
<picture>
{{ end }}
{{ if (and (ne .MediaType.SubType "svg") $webp) }}
<source
{{ if lt .Width 660 }}