hugo: Display images a figures

This commit is contained in:
Jan Kremer 2026-01-13 07:40:34 +01:00
parent 564fcf8038
commit 988507af98
No known key found for this signature in database
5 changed files with 34 additions and 13 deletions

View file

@ -0,0 +1,15 @@
{{- if .IsBlock -}}
<figure>
<img
src="{{ .Destination | safeURL }}"
{{- with .PlainText }}alt="{{ . }}"{{ end -}}
/>
{{- with .Title }}<figcaption>{{ . }}</figcaption>{{ end -}}
</figure>
{{- else -}}
<img
src="{{ .Destination | safeURL }}"
{{- with .PlainText }}alt="{{ . }}"{{ end -}}
{{- with .Title }}title="{{ . }}"{{ end -}}
/>
{{- end -}}