summaryrefslogtreecommitdiffstats
path: root/layouts/shortcodes/img-nz.html
diff options
context:
space:
mode:
authoramzrk22020-09-19 14:15:35 +0800
committeramzrk22020-09-19 14:15:35 +0800
commita43b353ca3e2d923ca8f0cdd1aeab70e5b1313a4 (patch)
treeb084c409a1ec2facb7230727bc0dd4e64e7df995 /layouts/shortcodes/img-nz.html
parent93722cd7f5fb51408a36c941c2188a373d01209b (diff)
downloadhugo-theme-fuji-a43b353ca3e2d923ca8f0cdd1aeab70e5b1313a4.tar.gz
hugo-theme-fuji-a43b353ca3e2d923ca8f0cdd1aeab70e5b1313a4.tar.bz2
hugo-theme-fuji-a43b353ca3e2d923ca8f0cdd1aeab70e5b1313a4.zip
new: lazyload image shortcodes
Diffstat (limited to 'layouts/shortcodes/img-nz.html')
-rw-r--r--layouts/shortcodes/img-nz.html10
1 files changed, 4 insertions, 6 deletions
diff --git a/layouts/shortcodes/img-nz.html b/layouts/shortcodes/img-nz.html
index 2e4b3af..175dc5b 100644
--- a/layouts/shortcodes/img-nz.html
+++ b/layouts/shortcodes/img-nz.html
@@ -1,7 +1,5 @@
-{{ if (index .Params 2) }}
-<a href="{{ index .Params 2 }}" target="_blank">
+{{- if len .Params | eq 2 -}}
+<p>
<img src="{{ index .Params 1 | relURL | safeURL }}" alt="{{ index .Params 0 }}" />
-</a>
-{{ else }}
-<img src="{{ index .Params 1 | relURL | safeURL }}" alt="{{ index .Params 0 }}" />
-{{ end }}
+</p>
+{{- end -}} \ No newline at end of file