summaryrefslogtreecommitdiff
path: root/layouts/shortcodes/img-pull-right.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/shortcodes/img-pull-right.html')
-rw-r--r--layouts/shortcodes/img-pull-right.html15
1 files changed, 13 insertions, 2 deletions
diff --git a/layouts/shortcodes/img-pull-right.html b/layouts/shortcodes/img-pull-right.html
index 8d73f48..4688b59 100644
--- a/layouts/shortcodes/img-pull-right.html
+++ b/layouts/shortcodes/img-pull-right.html
@@ -1,6 +1,17 @@
{{- $file := .Get 0 }}
{{- $path := printf "content_images/%s" $file}}
{{- $img := resources.Get $path }}
-{{- $img = $img.Resize "150x webp" }}
+{{- $img1x := $img.Resize "150x webp" }}
+{{- $img2x := $img.Resize "300x webp" }}
{{- $caption := .Get 1}}
- <img class="float-right" alt="{{ $caption }}" src="{{ $img.Permalink }}" width="{{ $img.Width }}" height="{{ $img.Height }}">
+ <img
+ class="float-right"
+ alt="{{ $caption }}"
+ src="{{ $img1x.Permalink }}"
+ srcset="
+ {{ $img1x.RelPermalink }} 1x,
+ {{ $img2x.RelPermalink }} 2x,
+ "
+ width="{{ $img1x.Width }}"
+ height="{{ $img1x.Height }}"
+>