Trying to lazy-load timeline images
This commit is contained in:
parent
5fb6bf59f7
commit
da80261202
|
@ -60,7 +60,7 @@
|
||||||
{{ range .Media }}
|
{{ range .Media }}
|
||||||
<div class="timeline-media mt3 {{ if eq .Type mediaembed }}timeline-embed{{ end }} overflow-hidden flex {{ if not (eq .Type mediaunknown) }}justify-center{{ end }}">
|
<div class="timeline-media mt3 {{ if eq .Type mediaembed }}timeline-embed{{ end }} overflow-hidden flex {{ if not (eq .Type mediaunknown) }}justify-center{{ end }}">
|
||||||
{{ if eq .Type mediaimage }}
|
{{ if eq .Type mediaimage }}
|
||||||
<img src="{{ .AssetUrl }}">
|
<img decoding="async" loading="lazy" src="{{ .AssetUrl }}" {{ if and .Width .Height }}style="aspect-ratio: {{ .Width }} / {{ .Height }};"{{ end }} />
|
||||||
{{ else if eq .Type mediavideo }}
|
{{ else if eq .Type mediavideo }}
|
||||||
{{ if .ThumbnailUrl }}
|
{{ if .ThumbnailUrl }}
|
||||||
<video src="{{ .AssetUrl }}" poster="{{ .ThumbnailUrl }}" preload="none" controls>
|
<video src="{{ .AssetUrl }}" poster="{{ .ThumbnailUrl }}" preload="none" controls>
|
||||||
|
|
Reference in New Issue