From a0a44a29f40cacb543b0344f669eb661cc1e0374 Mon Sep 17 00:00:00 2001 From: KemoNine Date: Thu, 23 Mar 2023 13:02:16 -0400 Subject: [PATCH] borrow figure shortcode from kemonine's blog for images --- themes/hugo-xmin/layouts/partials/figure.html | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 themes/hugo-xmin/layouts/partials/figure.html diff --git a/themes/hugo-xmin/layouts/partials/figure.html b/themes/hugo-xmin/layouts/partials/figure.html new file mode 100644 index 0000000..6b46f26 --- /dev/null +++ b/themes/hugo-xmin/layouts/partials/figure.html @@ -0,0 +1,29 @@ + + +{{- if not ($.Page.Scratch.Get "figurecount") }}{{ end }} +{{- $.Page.Scratch.Add "figurecount" 1 -}} + +{{- $thumb := .Get "src" | default (printf "%s." (.Get "thumb") | replace (.Get "link") ".") }} +
+
+
+ +
+ {{ with .Get "link" | default (.Get "src") }}{{ end }} + {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr")}} +
+ {{- with .Get "title" }}

{{.}}

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

+ {{- .Get "caption" | safeHTML -}} + {{- with .Get "attrlink"}}{{ .Get "attr" }}{{ else }}{{ .Get "attr"}}{{ end -}} +

+ {{- end }} +
+ {{- end }} +
+