From 712cb48fb26b52158cfcff555ba538739453a9df Mon Sep 17 00:00:00 2001 From: Alex Haslam Date: Sun, 8 Feb 2026 15:43:16 +0000 Subject: [PATCH] Allow markdown captions --- exampleSite/content/docs/shortcodes/index.md | 4 ++-- layouts/shortcodes/carousel.html | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/exampleSite/content/docs/shortcodes/index.md b/exampleSite/content/docs/shortcodes/index.md index 0ace0305..993a04b1 100644 --- a/exampleSite/content/docs/shortcodes/index.md +++ b/exampleSite/content/docs/shortcodes/index.md @@ -277,10 +277,10 @@ Captions are matched by key. For local images, use the filename (e.g. `01.jpg`). **Example 3:** Add captions ```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)}" >}}


diff --git a/layouts/shortcodes/carousel.html b/layouts/shortcodes/carousel.html index 73f3e258..55e69358 100644 --- a/layouts/shortcodes/carousel.html +++ b/layouts/shortcodes/carousel.html @@ -38,7 +38,7 @@ {{ if not .Parent }}
{{ end }}
@@ -83,7 +83,6 @@ data-twe-carousel-item style="transition-duration: {{ $interval }}ms;" {{ if eq $index 0 }}data-twe-carousel-active{{ end }}> -
{{ if $caption }}
{{ $caption | markdownify }}
{{ end }} -
{{ end }}