summaryrefslogtreecommitdiffstats
path: root/layouts/shortcodes
diff options
context:
space:
mode:
authoramzrk22020-05-27 22:53:13 +0800
committeramzrk22020-05-27 22:53:13 +0800
commitdfb6e1f80754c1c8f2d4d332c5292319f008a67b (patch)
treefd8c0cf13e03613b6a39c662b6a0ced87fb69157 /layouts/shortcodes
parentaa5290aeef9df1c583fdf30290351968df9215dc (diff)
downloadhugo-theme-fuji-dfb6e1f80754c1c8f2d4d332c5292319f008a67b.tar.gz
hugo-theme-fuji-dfb6e1f80754c1c8f2d4d332c5292319f008a67b.tar.bz2
hugo-theme-fuji-dfb6e1f80754c1c8f2d4d332c5292319f008a67b.zip
v2 original port
Diffstat (limited to 'layouts/shortcodes')
-rw-r--r--layouts/shortcodes/img-lazy.html10
-rw-r--r--layouts/shortcodes/img-nz-lazy.html25
-rw-r--r--layouts/shortcodes/img-nz.html7
-rw-r--r--layouts/shortcodes/lazyimg-col.html3
-rw-r--r--layouts/shortcodes/lazyimg-row.html3
-rw-r--r--layouts/shortcodes/lazyimg.html3
6 files changed, 42 insertions, 9 deletions
diff --git a/layouts/shortcodes/img-lazy.html b/layouts/shortcodes/img-lazy.html
new file mode 100644
index 0000000..fef9bd3
--- /dev/null
+++ b/layouts/shortcodes/img-lazy.html
@@ -0,0 +1,10 @@
+{{ 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 }} \ No newline at end of file
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
diff --git a/layouts/shortcodes/img-nz.html b/layouts/shortcodes/img-nz.html
new file mode 100644
index 0000000..1b4f791
--- /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 }} \ No newline at end of file
diff --git a/layouts/shortcodes/lazyimg-col.html b/layouts/shortcodes/lazyimg-col.html
deleted file mode 100644
index ce68446..0000000
--- a/layouts/shortcodes/lazyimg-col.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<p>
- <img class="lazyload img-zoomable" src="{{ .Site.Params.lazyPlaceholderCol }}" data-src="{{ index .Params 1 }}" alt="{{ index .Params 0 }}" />
-</p> \ No newline at end of file
diff --git a/layouts/shortcodes/lazyimg-row.html b/layouts/shortcodes/lazyimg-row.html
deleted file mode 100644
index 61e61ec..0000000
--- a/layouts/shortcodes/lazyimg-row.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<p>
- <img class="lazyload img-zoomable" src="{{ .Site.Params.lazyPlaceholderRow }}" data-src="{{ index .Params 1 }}" alt="{{ index .Params 0 }}" />
-</p> \ No newline at end of file
diff --git a/layouts/shortcodes/lazyimg.html b/layouts/shortcodes/lazyimg.html
deleted file mode 100644
index ff36b35..0000000
--- a/layouts/shortcodes/lazyimg.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<p>
- <img class="lazyload img-zoomable" src="{{ .Site.Params.lazyPlaceholder }}" data-src="{{ index .Params 1 }}" alt="{{ index .Params 0 }}" />
-</p> \ No newline at end of file