summaryrefslogtreecommitdiff
path: root/themes/cranky/layouts/shortcodes/img.html
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2023-11-14 17:14:20 -0500
committerBenjamin Chausse <benjamin@chausse.xyz>2023-11-14 17:14:20 -0500
commit81618e8bb6f00b3b74c30c1cc75a782cf266efd6 (patch)
tree3c2e85db1c401471004e5ca1241fa54e707c989f /themes/cranky/layouts/shortcodes/img.html
initial commit
Diffstat (limited to 'themes/cranky/layouts/shortcodes/img.html')
-rw-r--r--themes/cranky/layouts/shortcodes/img.html20
1 files changed, 20 insertions, 0 deletions
diff --git a/themes/cranky/layouts/shortcodes/img.html b/themes/cranky/layouts/shortcodes/img.html
new file mode 100644
index 0000000..ff7959b
--- /dev/null
+++ b/themes/cranky/layouts/shortcodes/img.html
@@ -0,0 +1,20 @@
+<!--
+ class: class of the figure
+ link: url the image directs to
+ alt: alternative text
+ caption: caption
+ mouse: what the image says when moused over ("title" in HTML)
+-->
+<figure {{ with .Get "class" }}class="{{.}}"{{ end -}}>
+ {{- with .Get "link"}}<a href="{{.}}">{{ end -}}
+ <img src="{{ .Get "src" }}"
+ {{- with .Get "mouse" }} title="{{.}}"{{ end -}}
+ {{- with .Get "alt" }} alt="{{.}}"{{ end -}}
+ >
+ {{- if .Get "link"}}</a>{{ end -}}
+ {{- with .Get "caption" -}}
+ <figcaption>
+ {{- . -}}
+ </figcaption>
+ {{- end -}}
+</figure>