summaryrefslogtreecommitdiffstats
path: root/layouts/shortcodes
diff options
context:
space:
mode:
authoramzrk22020-07-07 21:40:03 +0800
committeramzrk22020-07-07 21:40:03 +0800
commit7da818e69b76ff6764157da75137de69feadb7ce (patch)
tree6a7c17804675f52cf6d68261f59da448020af8c6 /layouts/shortcodes
parent39b230d730c44e9463c6c83ea7f81851a2048a5b (diff)
downloadhugo-theme-fuji-7da818e69b76ff6764157da75137de69feadb7ce.tar.gz
hugo-theme-fuji-7da818e69b76ff6764157da75137de69feadb7ce.tar.bz2
hugo-theme-fuji-7da818e69b76ff6764157da75137de69feadb7ce.zip
Fix medium-zoom
Diffstat (limited to 'layouts/shortcodes')
-rw-r--r--layouts/shortcodes/img-lazy.html44
-rw-r--r--layouts/shortcodes/img-nz-lazy.html49
-rw-r--r--layouts/shortcodes/img-nz.html7
3 files changed, 78 insertions, 22 deletions
diff --git a/layouts/shortcodes/img-lazy.html b/layouts/shortcodes/img-lazy.html
index e57b8fb..a8927a5 100644
--- a/layouts/shortcodes/img-lazy.html
+++ b/layouts/shortcodes/img-lazy.html
@@ -1,22 +1,22 @@
-{{- if len .Params | eq 2 -}}
-<p>
- <a href="{{ index .Params 1 | safeURL }}" target="_blank">
- <img class="lazyload" src="{{ .Site.Params.lazyPlaceholder | relURL }}"
- data-src="{{ index .Params 1 | safeURL }}" alt="{{ index .Params 0 }}" />
- </a>
-</p>
-{{- else if len .Params | eq 3 }}{{ if eq (index .Params 0) "row" -}}
-<p>
- <a href="{{ index .Params 2 | safeURL }}" target="_blank">
- <img class="lazyload" src="{{ .Site.Params.lazyPlaceholderRow | relURL }}"
- data-src="{{ index .Params 2 | safeURL }}" alt="{{ index .Params 1 }}" />
- </a>
-</p>
-{{- else if eq (index .Params 0) "col" -}}
-<p>
- <a href="{{ index .Params 2 | safeURL }}" target="_blank">
- <img class="lazyload" src="{{ .Site.Params.lazyPlaceholderCol | relURL }}"
- data-src="{{ index .Params 2 | safeURL }}" alt="{{ index .Params 1 }}" />
- </a>
-</p>
-{{- else -}}{{- end -}}{{- else -}}{{ end -}} \ No newline at end of file
+{{ if len .Params | eq 2 }}
+<img
+ class="lazyload img-zoomable"
+ 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 img-zoomable"
+ src="{{ .Site.Params.lazyPlaceholderRow | relURL }}"
+ data-src="{{ index .Params 2 }}"
+ alt="{{ index .Params 1 }}"
+/>
+{{ else if eq (index .Params 0) "col" }}
+<img
+ class="lazyload img-zoomable"
+ src="{{ .Site.Params.lazyPlaceholderCol | relURL }}"
+ data-src="{{ index .Params 2 }}"
+ alt="{{ index .Params 1 }}"
+/>
+{{ else }}{{ end }}{{ else }}{{ end }}
diff --git a/layouts/shortcodes/img-nz-lazy.html b/layouts/shortcodes/img-nz-lazy.html
new file mode 100644
index 0000000..a606f51
--- /dev/null
+++ b/layouts/shortcodes/img-nz-lazy.html
@@ -0,0 +1,49 @@
+{{ 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 }}
diff --git a/layouts/shortcodes/img-nz.html b/layouts/shortcodes/img-nz.html
new file mode 100644
index 0000000..30ea28a
--- /dev/null
+++ b/layouts/shortcodes/img-nz.html
@@ -0,0 +1,7 @@
+{{ if (index .Params 2) }}
+<a href="{{ index .Params 2 }}" target="_blank">
+ <img src="{{ index .Params 1 }}" alt="{{ index .Params 0 }}" />
+</a>
+{{ else }}
+<img src="{{ index .Params 1 }}" alt="{{ index .Params 0 }}" />
+{{ end }}