diff options
author | DSRKafuU | 2020-06-15 14:26:00 +0800 |
---|---|---|
committer | GitHub | 2020-06-15 14:26:00 +0800 |
commit | a27de2dabacb3b3ecddcefb90b893cc9c99fcfcf (patch) | |
tree | 8784324472b317dd4204f6620583add19cdf1956 /layouts/shortcodes | |
parent | 398ca6e2f300cce5c7bf7fa69fde42b4b592f5a4 (diff) | |
parent | d0569100c68fc2dd9c7fae4d91915fd49da8d71f (diff) | |
download | hugo-theme-fuji-a27de2dabacb3b3ecddcefb90b893cc9c99fcfcf.tar.gz hugo-theme-fuji-a27de2dabacb3b3ecddcefb90b893cc9c99fcfcf.tar.bz2 hugo-theme-fuji-a27de2dabacb3b3ecddcefb90b893cc9c99fcfcf.zip |
Merge branch 'dev' into google-adsense
Diffstat (limited to 'layouts/shortcodes')
-rw-r--r-- | layouts/shortcodes/img-lazy.html | 32 | ||||
-rw-r--r-- | layouts/shortcodes/img-nz-lazy.html | 25 | ||||
-rw-r--r-- | layouts/shortcodes/img-nz.html | 7 |
3 files changed, 22 insertions, 42 deletions
diff --git a/layouts/shortcodes/img-lazy.html b/layouts/shortcodes/img-lazy.html index fef9bd3..e57b8fb 100644 --- a/layouts/shortcodes/img-lazy.html +++ b/layouts/shortcodes/img-lazy.html @@ -1,10 +1,22 @@ -{{ 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 +{{- 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 diff --git a/layouts/shortcodes/img-nz-lazy.html b/layouts/shortcodes/img-nz-lazy.html deleted file mode 100644 index bfdb26a..0000000 --- a/layouts/shortcodes/img-nz-lazy.html +++ /dev/null @@ -1,25 +0,0 @@ -{{ 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 deleted file mode 100644 index 1b4f791..0000000 --- a/layouts/shortcodes/img-nz.html +++ /dev/null @@ -1,7 +0,0 @@ -{{ 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 |