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