mirror of
https://github.com/TrezOne/congo-hindi-gujarati.git
synced 2026-07-20 09:51:37 -04:00
✨ feat: Make image lazy load togglable
This commit is contained in:
@@ -11,7 +11,9 @@
|
||||
<img
|
||||
class="mx-auto my-0 rounded-md"
|
||||
alt="{{ $altText }}"
|
||||
loading="lazy"
|
||||
{{ if .Site.Params.enableImageLazyLoading | default true }}
|
||||
loading="lazy"
|
||||
{{ end }}
|
||||
{{ if findRE "^https?" $url.Scheme }}
|
||||
src="{{ $url.String }}"
|
||||
{{ else }}
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
{{- if or (.Get "alt") (.Get "caption") }}
|
||||
alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify | plainify }}{{ end }}"
|
||||
{{- end -}}
|
||||
loading="lazy"
|
||||
{{ if .Site.Params.enableImageLazyLoading | default true }}
|
||||
loading="lazy"
|
||||
{{ end }}
|
||||
width="100%"
|
||||
height="auto"
|
||||
style="max-width:{{ div $image.Width 2 }}px; max-height:{{ div $image.Height 2 }}px;"
|
||||
|
||||
Reference in New Issue
Block a user