diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html
new file mode 100644
index 0000000..3676c68
--- /dev/null
+++ b/layouts/shortcodes/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" -}}
+ {{- with .Get "attrlink"}}{{ .Get "attr" }}{{ else }}{{ .Get "attr"}}{{ end -}}
+
+ {{- end }}
+
+ {{- end }}
+
+
diff --git a/layouts/shortcodes/gallery.html b/layouts/shortcodes/gallery.html
new file mode 100644
index 0000000..6c644b9
--- /dev/null
+++ b/layouts/shortcodes/gallery.html
@@ -0,0 +1,41 @@
+
+
+{{- if not ($.Page.Scratch.Get "figurecount") }}{{ end }}
+{{- $.Page.Scratch.Add "figurecount" 1 }}
+{{ $baseURL := .Site.BaseURL }}
+
+ {{- with (.Get "dir") -}}
+
+ {{- $files := readDir (print "/static/" .) }}
+ {{- range $files -}}
+
+ {{- $thumbext := $.Get "thumb" | default "-thumb" }}
+ {{- $isthumb := .Name | findRE ($thumbext | printf "%s\\.") }}
+ {{- $isimg := lower .Name | findRE "\\.(gif|jpg|jpeg|tiff|png|bmp|webp|avif|jxl)" }}
+ {{- if and $isimg (not $isthumb) }}
+ {{- $caption := .Name | replaceRE "\\..*" "" | humanize }}
+ {{- $linkURL := print $baseURL ($.Get "dir") "/" .Name | absURL }}
+ {{- $thumb := .Name | replaceRE "(\\.)" ($thumbext | printf "%s.") }}
+ {{- $thumbexists := where $files "Name" $thumb }}
+ {{- $thumbURL := print $baseURL ($.Get "dir") "/" $thumb | absURL }}
+
+
+
+

+
+
+ {{ $caption }}
+
+
+
+
+ {{- end }}
+ {{- end }}
+ {{- else -}}
+
+ {{ .Inner }}
+ {{- end }}
+