summaryrefslogtreecommitdiffstats
path: root/layouts/shortcodes/img-nz-lazy.html
diff options
context:
space:
mode:
authoramzrk22020-07-24 09:17:09 +0800
committeramzrk22020-07-24 09:17:09 +0800
commit9897eff5d4fe78e26efd5e362cd32672575fae14 (patch)
treeb0ecc5483044a81e8185a2606ded2084ea6b0db7 /layouts/shortcodes/img-nz-lazy.html
parent3483f357ac417d7418461c01a5ab1cfc91816431 (diff)
downloadhugo-theme-fuji-9897eff5d4fe78e26efd5e362cd32672575fae14.tar.gz
hugo-theme-fuji-9897eff5d4fe78e26efd5e362cd32672575fae14.tar.bz2
hugo-theme-fuji-9897eff5d4fe78e26efd5e362cd32672575fae14.zip
Fix image relative link issue
Diffstat (limited to 'layouts/shortcodes/img-nz-lazy.html')
-rw-r--r--layouts/shortcodes/img-nz-lazy.html12
1 files changed, 6 insertions, 6 deletions
diff --git a/layouts/shortcodes/img-nz-lazy.html b/layouts/shortcodes/img-nz-lazy.html
index a606f51..8a46329 100644
--- a/layouts/shortcodes/img-nz-lazy.html
+++ b/layouts/shortcodes/img-nz-lazy.html
@@ -2,21 +2,21 @@
<img
class="lazyload"
src="{{ .Site.Params.lazyPlaceholder | relURL }}"
- data-src="{{ index .Params 1 }}"
+ data-src="{{ index .Params 1 | relURL | safeURL }}"
alt="{{ index .Params 0 }}"
/>
{{ else if len .Params | eq 3 }}{{ if eq (index .Params 0) "row" }}
<img
class="lazyload"
src="{{ .Site.Params.lazyPlaceholderRow | relURL }}"
- data-src="{{ index .Params 2 }}"
+ data-src="{{ index .Params 2 | relURL | safeURL }}"
alt="{{ index .Params 1 }}"
/>
{{ else if eq (index .Params 0) "col" }}
<img
class="lazyload"
src="{{ .Site.Params.lazyPlaceholderCol | relURL }}"
- data-src="{{ index .Params 2 }}"
+ data-src="{{ index .Params 2 | relURL | safeURL }}"
alt="{{ index .Params 1 }}"
/>
{{ else }}
@@ -24,7 +24,7 @@
<img
class="lazyload"
src="{{ .Site.Params.lazyPlaceholder | relURL }}"
- data-src="{{ index .Params 1 }}"
+ data-src="{{ index .Params 1 | relURL | safeURL }}"
alt="{{ index .Params 0 }}"
/>
</a>
@@ -33,7 +33,7 @@
<img
class="lazyload"
src="{{ .Site.Params.lazyPlaceholderRow | relURL }}"
- data-src="{{ index .Params 2 }}"
+ data-src="{{ index .Params 2 | relURL | safeURL }}"
alt="{{ index .Params 1 }}"
/>
</a>
@@ -42,7 +42,7 @@
<img
class="lazyload"
src="{{ .Site.Params.lazyPlaceholderCol | relURL }}"
- data-src="{{ index .Params 2 }}"
+ data-src="{{ index .Params 2 | relURL | safeURL }}"
alt="{{ index .Params 1 }}"
/>
</a>