Image partial: add support for attribution, title parameters

This commit is contained in:
Dawid Wróbel 2024-05-27 18:18:30 +02:00
parent d005f1e798
commit 248629e1d4

View File

@ -1,5 +1,5 @@
<!-- prettier-ignore --> <!-- prettier-ignore -->
{{ if .caption }} {{- if or (or .title .caption) .attr -}}
<figure> <figure>
{{ end }} {{ end }}
@ -90,7 +90,19 @@
<!-- prettier-ignore --> <!-- prettier-ignore -->
{{ if .caption }} {{- if or (or .title .caption) .attr -}}
<figcaption>{{ .page.RenderString .caption }}</figcaption> <figcaption>
</figure> {{ with .title -}}
{{ . }}
{{- end -}}
{{- if or .caption .attr -}}<p>
{{- .caption | markdownify -}}
{{- with .attrlink }}
<a href="{{ . }}">
{{- end -}}
{{- .attr | markdownify -}}
{{- if .attrlink }}</a>{{ end }}</p>
{{- end }}
</figcaption>
</figure>
{{ end }} {{ end }}