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) }}
|
{{ $resource = resources.Get ($url.String) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ with $resource }}
|
{{ 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) }}
|
{{ if (and (ne .MediaType.SubType "svg") $webp) }}
|
||||||
<source
|
<source
|
||||||
{{ if lt .Width 660 }}
|
{{ if lt .Width 660 }}
|
||||||
|
|
Loading…
Reference in New Issue