mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2024-12-22 04:13:17 -06:00
Lazy load images
This commit is contained in:
parent
f33492ef8e
commit
6c42ae9518
@ -9,7 +9,7 @@
|
|||||||
{{ with index . "src" }}
|
{{ with index . "src" }}
|
||||||
{{ $media := . }}
|
{{ $media := . }}
|
||||||
{{ if eq .MediaType.MainType "image" }}
|
{{ if eq .MediaType.MainType "image" }}
|
||||||
<img src="{{ $media.Permalink }}" alt="{{ $media.Title }}" />
|
<img src="{{ $media.Permalink }}" alt="{{ $media.Title }}" loading="lazy" />
|
||||||
{{ else if eq .MediaType.MainType "video" }}
|
{{ else if eq .MediaType.MainType "video" }}
|
||||||
<video controls preload="metadata">
|
<video controls preload="metadata">
|
||||||
<source src="{{ $media.Permalink }}" alt="{{ $media.Title }}">
|
<source src="{{ $media.Permalink }}" alt="{{ $media.Title }}">
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if eq $type "image" }}
|
{{ if eq $type "image" }}
|
||||||
<img src="{{ $src }}" alt="{{ $alt }}" />
|
<img src="{{ $src }}" alt="{{ $alt }}" loading="lazy" />
|
||||||
{{ else if eq $type "video" }}
|
{{ else if eq $type "video" }}
|
||||||
<video controls preload="metadata">
|
<video controls preload="metadata">
|
||||||
<source src="{{ $src }}" alt="{{ $alt }}">
|
<source src="{{ $src }}" alt="{{ $alt }}">
|
||||||
|
Loading…
Reference in New Issue
Block a user