summaryrefslogtreecommitdiffstats
path: root/layouts/shortcodes/img-nz-lazy.html
diff options
context:
space:
mode:
authorDSRKafuU2020-06-04 07:21:13 -0500
committerGitHub2020-06-04 07:21:13 -0500
commit73244a2e55dffa158027126346eefd5bafa5fea8 (patch)
treec98ee9fbdb6f474579aa769a2a4b0b4c98fd21f1 /layouts/shortcodes/img-nz-lazy.html
parentaa5290aeef9df1c583fdf30290351968df9215dc (diff)
parent914bf54c493b299268c293be33a8babf99b1cce2 (diff)
downloadhugo-theme-fuji-73244a2e55dffa158027126346eefd5bafa5fea8.tar.gz
hugo-theme-fuji-73244a2e55dffa158027126346eefd5bafa5fea8.tar.bz2
hugo-theme-fuji-73244a2e55dffa158027126346eefd5bafa5fea8.zip
Merge pull request #24 from amzrk2/dev
v2 pre-release
Diffstat (limited to 'layouts/shortcodes/img-nz-lazy.html')
-rw-r--r--layouts/shortcodes/img-nz-lazy.html25
1 files changed, 25 insertions, 0 deletions
diff --git a/layouts/shortcodes/img-nz-lazy.html b/layouts/shortcodes/img-nz-lazy.html
new file mode 100644
index 0000000..bfdb26a
--- /dev/null
+++ b/layouts/shortcodes/img-nz-lazy.html
@@ -0,0 +1,25 @@
+{{ if len .Params | eq 2 }}
+<img class="lazyload" src="{{ .Site.Params.lazyPlaceholder | relURL }}" data-src="{{ index .Params 1 }}"
+ 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 }}"
+ alt="{{ index .Params 1 }}" />
+{{ else if eq (index .Params 0) "col" }}
+<img class="lazyload" src="{{ .Site.Params.lazyPlaceholderCol | relURL }}" data-src="{{ index .Params 2 }}"
+ alt="{{ index .Params 1 }}" />
+{{ else }}
+<a href="{{ index .Params 2 }}" target="_blank">
+ <img class="lazyload" src="{{ .Site.Params.lazyPlaceholder | relURL }}" data-src="{{ index .Params 1 }}"
+ alt="{{ index .Params 0 }}" />
+</a>
+{{ end }}{{ else if len .Params | eq 4 }}{{ if eq (index .Params 0) "row" }}
+<a href="{{ index .Params 3 }}" target="_blank">
+ <img class="lazyload" src="{{ .Site.Params.lazyPlaceholderRow | relURL }}" data-src="{{ index .Params 2 }}"
+ alt="{{ index .Params 1 }}" />
+</a>
+{{ else if eq (index .Params 0) "col" }}
+<a href="{{ index .Params 3 }}" target="_blank">
+ <img class="lazyload" src="{{ .Site.Params.lazyPlaceholderCol | relURL }}" data-src="{{ index .Params 2 }}"
+ alt="{{ index .Params 1 }}" />
+</a>
+{{ else }}{{ end }}{{ else }}{{ end }} \ No newline at end of file