Allow markdown captions

This commit is contained in:
Alex Haslam
2026-02-08 15:43:16 +00:00
parent 73580313b4
commit 712cb48fb2
2 changed files with 5 additions and 7 deletions
+2 -2
View File
@@ -277,10 +277,10 @@ Captions are matched by key. For local images, use the filename (e.g. `01.jpg`).
**Example 3:** Add captions **Example 3:** Add captions
```md ```md
{{</* carousel images="gallery/*" captions="{01.jpg:First image,02.jpg:Second image}" */>}} {{</* carousel images="gallery/*" captions="{01.jpg:First *image*,02.jpg:Second image with a [link](https://example.com)}" */>}}
``` ```
{{< carousel images="gallery/*" captions="{01.jpg:First image,02.jpg:Second image}" >}} {{< carousel images="gallery/*" captions="{01.jpg:First *image*,02.jpg:Second image with a [link](https://example.com)}" >}}
<br/><br/><br/> <br/><br/><br/>
+3 -5
View File
@@ -38,7 +38,7 @@
{{ if not .Parent }}<div class="width-patch"></div>{{ end }} {{ if not .Parent }}<div class="width-patch"></div>{{ end }}
<div <div
id="{{ $id }}" id="{{ $id }}"
class="relative not-prose" class="relative"
data-twe-carousel-init data-twe-carousel-init
data-twe-ride="carousel" data-twe-ride="carousel"
data-twe-interval="{{ $interval }}"> data-twe-interval="{{ $interval }}">
@@ -83,7 +83,6 @@
data-twe-carousel-item data-twe-carousel-item
style="transition-duration: {{ $interval }}ms;" style="transition-duration: {{ $interval }}ms;"
{{ if eq $index 0 }}data-twe-carousel-active{{ end }}> {{ if eq $index 0 }}data-twe-carousel-active{{ end }}>
<figure class="m-0 relative">
<div class="single_hero_background relative overflow-hidden" style="aspect-ratio: {{ $aspectx }} / {{ $aspecty }};"> <div class="single_hero_background relative overflow-hidden" style="aspect-ratio: {{ $aspectx }} / {{ $aspecty }};">
<img <img
src="{{ $resource.RelPermalink }}" src="{{ $resource.RelPermalink }}"
@@ -92,11 +91,10 @@
</div> </div>
{{ if $caption }} {{ if $caption }}
<figcaption <figcaption
class="absolute left-0 right-0 text-left text-sm text-neutral-500 not-prose leading-snug [&>p]:m-0" class="absolute left-0 right-0"
style="top: calc(100% + 0.5rem);" style="top: calc(100%);"
>{{ $caption | markdownify }}</figcaption> >{{ $caption | markdownify }}</figcaption>
{{ end }} {{ end }}
</figure>
</div> </div>
{{ end }} {{ end }}
</div> </div>