Carousel
Last Edit: 2026-06-09
Creates carousel of images.
Pass images in as a dictionary. Modified version of the Bootstrap carousel, no longer requiring JavaScript to function.
Images are resized to 1920x, preserving aspect ratio, and compressed using lanczos.
Carousel partial accepts a dictionary of images; carousel shortcode accepts <= 21 image paths.
Usage
Partial
{{ $carouselImages := resources.Match "images/example/*" }}
{{ partial "carousel" (dict "images" $carouselImages) }}{{ $carouselImages := slice (resources.Get "images/example/1.jpg") (resources.Get "img/exp/4.jpg") }}
{{ partial "carousel" (dict "images" $carouselImages) }}Shortcode
{{< carousel "images/example/1.jpg" "img/exp/4.jpg" >}}Example
{{ $carouselImages := resources.Match "/test/*.jpg" }}
{{ partial "carousel" (dict "images" $carouselImages) }}{{< carousel "/test/01.jpg" "/test/02.jpg" "/test/03.jpg" >}}

