summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--layouts/_shortcodes/float-image.html13
1 files changed, 13 insertions, 0 deletions
diff --git a/layouts/_shortcodes/float-image.html b/layouts/_shortcodes/float-image.html
new file mode 100644
index 00000000..2c03992d
--- /dev/null
+++ b/layouts/_shortcodes/float-image.html
@@ -0,0 +1,13 @@
+{{ $src := .Get 0 }}
+
+{{ $float := .Get 1 }}
+{{ $padding := "" }}
+{{ if eq $float "left" }}
+ {{ $padding = "pr-4 sm:pr-6 md:pr-8" }}
+{{ else }}
+ {{ $padding = "pl-4 sm:pl-6 md:pr-8" }}
+{{ end }}
+
+<figure style="float: {{ $float }}" class="{{ $padding }} w-25 sm:w-30 md:w-50">
+ <img src="{{ $src }}" data-libra class="my-0" />
+</figure>