mirror of https://github.com/jpanther/congo.git
added lqip to picture
parent
9b64aa8c30
commit
8989f5186a
|
@ -22,7 +22,15 @@
|
|||
{{ $resource = resources.Get ($url.String) }}
|
||||
{{ end }}
|
||||
{{ with $resource }}
|
||||
{{ 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 }}
|
||||
|
|
Loading…
Reference in New Issue