From 043ec4b61363fe28b2d2d8ac9e17e9386bf7175d Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sun, 5 Apr 2026 09:34:21 +0200 Subject: feat: add figure shortcode and documentation Ported figure shortcode from previous theme. Wraps content in semantic
element with optional title, caption, attribution, and link support. Typical usage: {{< figure caption="Image caption" attr="Photo by Someone" >}} {{< img src="image.jpg" alt="Description" >}} {{< /figure >}} Also updated CONTENT_GUIDE with comprehensive usage examples and parameters. Co-Authored-By: Claude Haiku 4.5 --- layouts/shortcodes/figure.html | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 layouts/shortcodes/figure.html (limited to 'layouts/shortcodes') diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html new file mode 100644 index 0000000..81f86de --- /dev/null +++ b/layouts/shortcodes/figure.html @@ -0,0 +1,27 @@ +{{/* + * This version of the figure shortcode needs to be closed and doesn't + * add an image itself, but relies on the img.html shortcode to provide + * a responsive image instead. + */}} + + {{- if .Get "link" -}} + + {{- end -}} + {{- .Inner -}} + {{- if .Get "link" }}{{ end -}} + {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}} +
+ {{ with (.Get "title") -}} +

{{ . }}

+ {{- end -}} + {{- if or (.Get "caption") (.Get "attr") -}}

+ {{- .Get "caption" | markdownify -}} + {{- with .Get "attrlink" }} + + {{- end -}} + {{- .Get "attr" | markdownify -}} + {{- if .Get "attrlink" }}{{ end }}

+ {{- end }} +
+ {{- end }} +
-- cgit v1.2.3