diff options
| author | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2021-03-16 13:18:57 +0530 |
|---|---|---|
| committer | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2021-03-16 13:18:57 +0530 |
| commit | c353447d8e6dbbec9e21c8ef57b1da1e177f2a16 (patch) | |
| tree | 4fcdf33b1fbe13d84e4487506af2e70681698f8d /layouts/shortcodes | |
| parent | a982a29e24b382dd658fc53863b4205f7b5b7898 (diff) | |
add browser-level lazy loading
ref: https://web.dev/browser-level-image-lazy-loading/
Diffstat (limited to 'layouts/shortcodes')
| -rw-r--r-- | layouts/shortcodes/figure.html | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index 77f188e..8c93eff 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -5,7 +5,7 @@ {{- if .Get "link" -}} <a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}> {{- end }} - <img src="{{ .Get "src" }}{{- if eq (.Get "align") "center" }}#center{{- end }}" + <img loading="lazy" src="{{ .Get "src" }}{{- if eq (.Get "align") "center" }}#center{{- end }}" {{- if or (.Get "alt") (.Get "caption") }} alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}" {{- end -}} |
