From 248629e1d4a7ae064dbf841782a5c483cf957deb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Wro=CC=81bel?= Date: Mon, 27 May 2024 18:18:30 +0200 Subject: [PATCH] Image partial: add support for attribution, title parameters --- layouts/partials/image.html | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/layouts/partials/image.html b/layouts/partials/image.html index 80e510b5..a6478e99 100644 --- a/layouts/partials/image.html +++ b/layouts/partials/image.html @@ -1,5 +1,5 @@ -{{ if .caption }} +{{- if or (or .title .caption) .attr -}}
{{ end }} @@ -90,7 +90,19 @@ -{{ if .caption }} -
{{ .page.RenderString .caption }}
-
+{{- if or (or .title .caption) .attr -}} +
+ {{ with .title -}} + {{ . }} + {{- end -}} + {{- if or .caption .attr -}}

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

+ {{- end }} +
+ {{ end }} \ No newline at end of file