aboutsummaryrefslogtreecommitdiff
path: root/layouts/shortcodes
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2023-10-02 09:02:20 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2023-10-02 09:02:20 +0200
commit2c17fbcdf8ea36d9d10dba243db94de85575e8ed (patch)
tree6609bbe9837d851f3d0be160f025285606465dc4 /layouts/shortcodes
parentc6ef2fd7aeff28abfd4ec372262de3ecd4684c04 (diff)
chore: Copy theme layouts
Diffstat (limited to 'layouts/shortcodes')
-rw-r--r--layouts/shortcodes/begin-task-list.html1
-rw-r--r--layouts/shortcodes/img.html23
2 files changed, 24 insertions, 0 deletions
diff --git a/layouts/shortcodes/begin-task-list.html b/layouts/shortcodes/begin-task-list.html
new file mode 100644
index 0000000..73a7776
--- /dev/null
+++ b/layouts/shortcodes/begin-task-list.html
@@ -0,0 +1 @@
+<span class="begin-task-list"></span>
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" }}
+
+<figure class='mb-5{{ if eq $position "center" }} flex justify-center{{ end }}'>
+ <img src="{{ $img.RelPermalink }}" {{ with $alt }}alt="{{ . }}"{{end}} width="{{ $img.Width }}" height="{{ $img.Height }}" >
+</figure> \ No newline at end of file