summaryrefslogtreecommitdiff
path: root/layouts/shortcodes/img-r.html
diff options
context:
space:
mode:
authormms <michal@sapka.me>2023-12-22 22:22:14 +0100
committermms <michal@sapka.me>2023-12-22 22:22:14 +0100
commit577bb0c8efadfb7c60e0fed8e46f986bd6edcb7a (patch)
tree964e8c9025a8d8382558ff07e6ef135a201f5cc3 /layouts/shortcodes/img-r.html
parenta834ab11ba14daf6f1d7c95705c26cb7c4e30507 (diff)
feat: org for st, fin
Diffstat (limited to 'layouts/shortcodes/img-r.html')
-rw-r--r--layouts/shortcodes/img-r.html17
1 files changed, 17 insertions, 0 deletions
diff --git a/layouts/shortcodes/img-r.html b/layouts/shortcodes/img-r.html
new file mode 100644
index 0000000..4340792
--- /dev/null
+++ b/layouts/shortcodes/img-r.html
@@ -0,0 +1,17 @@
+{{- $file := .Get 0 }}
+{{- $path := printf "content_images/%s" $file}}
+{{- $img := resources.Get $path }}
+{{- $img1x := $img.Resize "150x webp" }}
+{{- $img2x := $img.Resize "300x webp" }}
+{{- $caption := .Inner}}
+ <img
+ class="float-right"
+ alt="{{ $caption }}"
+ src="{{ $img1x.Permalink }}"
+ srcset="
+ {{ $img1x.RelPermalink }} 1x,
+ {{ $img2x.RelPermalink }} 2x
+ "
+ width="{{ $img1x.Width }}"
+ height="{{ $img1x.Height }}"
+>