Merge pull request #2771 from alxhslm/gallery-captions

Feat: Allow images inside gallery to have captions
This commit is contained in:
Nuno C. authored and GitHub committed 2026-02-11 21:47:24 +00:00
commit 326e3536e9
3 files changed
+39 -1

No files matched your search

+2 -1
View File
@@ -7,10 +7,11 @@
{{- $caption := .Get "caption" }}
{{- $href := .Get "href" }}
{{- $class := .Get "class" }}
{{- $figureClass := .Get "figureClass" }}
{{- $target := .Get "target" | default "_blank" }}
{{- $nozoom := .Get "nozoom" | default false -}}
<figure>
<figure{{ with $figureClass }} class="{{ . }}"{{ end }}>
{{- with $href }}<a href="{{ . }}" {{ with $target }}target="{{ . }}"{{ end }} class="inline-block">{{ end -}}
{{- if findRE "^https?" $url.Scheme }}
<img class="my-0 rounded-md{{ with $nozoom }} nozoom{{ end }}{{ with $class }} {{ . }}{{ end }}" src="{{ $url.String }}" alt="{{ $altText }}" />