add caption on slideshow and lightbox

This commit is contained in:
2024-02-07 21:32:54 +01:00
parent 30f01d96ec
commit c3935f1924
3 changed files with 42 additions and 16 deletions

View File

@@ -3,13 +3,16 @@
<div class="snap-lightbox" id="snap-lightbox-{{ $galno }}">
{{- range $i, $img := $imgs }}
<div class="snap-lightbox-inner">
<div class="numbertext">{{ add $i 1 }} / {{ len $imgs }}</div>
<div class="snap-numbertext">{{ add $i 1 }} / {{ len $imgs }}</div>
<img
src="{{ relURL $img.src }}"
{{ range $attr, $value := $img.html -}}
{{ safeHTMLAttr $attr }}={{ $value }}
{{ end -}}
/>
{{- with $img.html.title }}
<div class="snap-caption">{{ . }}</div>
{{- end }}
</div>
{{- end -}}
@@ -18,9 +21,4 @@
<a class="snap-prev" onclick="moveLightboxItem({{ $galno }}, -1)"><span>&#10094;</span></a>
<a class="snap-next" onclick="moveLightboxItem({{ $galno }}, 1)"><span>&#10095;</span></a>
{{/* <!-- Caption text -->
<div class="caption-container">
<p id="caption"></p>
</div> */}}
</div>