From 57263cb4d015a57f279de30b867fb73c01c8cd82 Mon Sep 17 00:00:00 2001 From: "Charles.Day" <47104966+AstroNomen@users.noreply.github.com> Date: Tue, 24 Dec 2024 14:03:10 +0100 Subject: [PATCH] add caption rendering when render the image, also render the markdown caption --- layouts/_default/_markup/render-image.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index 0ed5584..df4f7f9 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -1,6 +1,7 @@ {{- $image := .Page.Resources.GetMatch (printf "%s" (.Destination | safeURL)) -}} {{- $Permalink := .Destination | relURL | safeURL -}} {{- $alt := .PlainText | safeHTML -}} +{{- $title := .Title | safeHTML -}} {{- $Width := 0 -}} {{- $Height := 0 -}} {{- $Srcset := "" -}} @@ -38,4 +39,7 @@ data-flex-grow="{{ div (mul $image.Width 100) $image.Height }}" data-flex-basis="{{ div (mul $image.Width 240) $image.Height }}px" {{ end }} -> \ No newline at end of file +> +{{- if $title }} +
{{ .Title }}
+{{- end }}