Lazy load markdown images to improve mobile experience
This commit is contained in:
parent
89a5bc6c96
commit
61a560d90b
@ -4,7 +4,7 @@
|
||||
{{- $img = resources.Get $path -}}
|
||||
{{- end -}}
|
||||
{{- with $img -}}
|
||||
<img alt="{{ $.Text }}" src="{{ $img.RelPermalink }}" width={{ $img.Width }} height={{ $img.Height }} />
|
||||
<img alt="{{ $.Text }}" src="{{ $img.RelPermalink }}" width={{ $img.Width }} height={{ $img.Height }} loading="lazy" />
|
||||
{{- else -}}
|
||||
<img alt="{{ $.Text }}" src="{{ $.Destination | safeURL }}" />
|
||||
<img alt="{{ $.Text }}" src="{{ $.Destination | safeURL }}" loading="lazy" />
|
||||
{{- end -}}
|
Loading…
x
Reference in New Issue
Block a user