diff --git a/layouts/partials/images/figure.html b/layouts/partials/images/figure.html
index 1d853a7..5ebc076 100644
--- a/layouts/partials/images/figure.html
+++ b/layouts/partials/images/figure.html
@@ -1,4 +1,4 @@
{{ partial "images/picture" (merge .ctx (dict "className" (printf "%s %s" .figureImgClass .className))) }}
- {{ .caption }}
+ {{ .ctx.caption }}
diff --git a/layouts/partials/images/image.html b/layouts/partials/images/image.html
index 6f78fb0..5fa8b33 100644
--- a/layouts/partials/images/image.html
+++ b/layouts/partials/images/image.html
@@ -203,6 +203,7 @@
"className" $className
"src" $src
"alt" $alt
+ "caption" $caption
"lazyLoading" $lazyLoading
"naturalHeight" $naturalHeight
"naturalWidth" $naturalWidth
@@ -222,7 +223,6 @@
"figureImgClass" $figureImgClass
"className" $className
"figureCaptionClass" $figureCaptionClass
- "caption" $caption
"ctx" $ctx
) }}
{{- else }}
diff --git a/layouts/partials/images/picture.html b/layouts/partials/images/picture.html
index 22d5586..db32df4 100644
--- a/layouts/partials/images/picture.html
+++ b/layouts/partials/images/picture.html
@@ -7,6 +7,9 @@
(printf `src="%s"` .src)
(printf `alt="%s"` .alt)
}}
+ {{- with .caption }}
+ {{- $attrs = $attrs | append (printf `title="%s"` .) }}
+ {{- end }}
{{- if .lazyLoading }}
{{- $attrs = $attrs | append `loading="lazy"` }}
{{- end }}