Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/rmaguiar/hugo-theme-color-your-world.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrmaguiar <rmaguiar@tuta.io>2020-07-07 00:29:57 +0300
committerrmaguiar <rmaguiar@tuta.io>2020-07-07 00:29:57 +0300
commitc6b316091bd2cb3e6f5fd046999a54cd18f553d2 (patch)
tree6ae9c2bcbe1e619cc345720cc9553183f743c1a0 /layouts/shortcodes/figure.html
parent013f189d1cb4aee14801280688dc3ebd8af3bf76 (diff)
Add archetypes and minor changes
Diffstat (limited to 'layouts/shortcodes/figure.html')
-rw-r--r--layouts/shortcodes/figure.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html
index f64607e..f9d6c9a 100644
--- a/layouts/shortcodes/figure.html
+++ b/layouts/shortcodes/figure.html
@@ -35,14 +35,14 @@
Reduce reflow by generating a placeholder with similar size
-->
- {{ $encodedPlaceholder := printf "image/png;base64,%s" (((resources.Get "pixel.gif").Resize (printf "%vx%v %s" (.Resize (index $mediumRes 0)).Width (.Resize (index $mediumRes 0)).Height "png")).Content | base64Encode) }}
+ {{ $encodedPlaceholder := (printf "data:image/png;base64,%s" (((resources.Get "pixel.gif").Resize (printf "%vx%v %s" (.Resize (index $mediumRes 0)).Width (.Resize (index $mediumRes 0)).Height "png")).Content | base64Encode)) | safeURL }}
<figure>
<img
class="lazyload {{ $class }}"
loading="lazy"
data-srcset="{{ (.Resize (index $highRes 0)).RelPermalink }} {{ index $highRes 1 }}, {{ (.Resize (index $mediumRes 0)).RelPermalink }} {{ index $mediumRes 1 }}, {{ (.Resize (index $lowRes 0)).RelPermalink }} {{ index $lowRes 1 }}"
- src="data:{{ $encodedPlaceholder }}"
+ src="{{ $encodedPlaceholder }}"
data-src="{{ (.Resize (index $mediumRes 0)).RelPermalink }}"
{{ with $alt }}alt="{{ . }}"{{ end }}
/>
@@ -52,7 +52,7 @@
{{ with $class }}class="{{ . }}"{{ end }}
loading="lazy"
srcset="{{ (.Resize (index $highRes 0)).RelPermalink }} {{ index $highRes 1 }}, {{ (.Resize (index $mediumRes 0)).RelPermalink }} {{ index $mediumRes 1 }}, {{ (.Resize (index $lowRes 0)).RelPermalink }} {{ index $lowRes 1 }}"
- src="data:{{ $encodedPlaceholder }}"
+ src="{{ $encodedPlaceholder }}"
{{ with $alt }}alt="{{ . }}"{{ end }}
/>
</noscript>