From 2c17fbcdf8ea36d9d10dba243db94de85575e8ed Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Mon, 2 Oct 2023 09:02:20 +0200 Subject: chore: Copy theme layouts --- layouts/shortcodes/img.html | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 layouts/shortcodes/img.html (limited to 'layouts/shortcodes/img.html') diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html new file mode 100644 index 0000000..a0673a3 --- /dev/null +++ b/layouts/shortcodes/img.html @@ -0,0 +1,23 @@ +{{/* Image Resources */}} +{{ $img := .Page.Resources.GetMatch (printf "%s" (.Get "src" | safeURL ))}} +{{ $alt := .Get "alt"}} + +{{/* Image Processing */}} +{{ $command := .Get "size-method" }} +{{ $options := .Get "size-format" }} +{{ if eq $command "Fit"}} + {{ $img = $img.Fit $options }} +{{ else if eq $command "Resize"}} + {{ $img = $img.Resize $options }} +{{ else if eq $command "Fill"}} + {{ $img = $img.Fill $options }} +{{ else if eq $command "Crop"}} + {{ $img = $img.Crop $options }} +{{ end }} + +{{/* Position */}} +{{ $position := .Get "position" }} + +
+ +
\ No newline at end of file -- cgit v1.3