2023-12-12 18:56:08 +01:00
|
|
|
{{ $dir := (.Get "dir") }}
|
|
|
|
{{ if $dir }}
|
2023-04-05 14:16:33 +02:00
|
|
|
<div class="card border-primary rounded-3">
|
2023-12-12 18:56:08 +01:00
|
|
|
<div class="carousel carousel-dark slide mb-0" data-bs-ride="true" id='slider-{{ md5 $dir }}'>
|
|
|
|
{{ $images := slice }}
|
|
|
|
{{ range readDir (print "/static/" $dir) }}
|
|
|
|
{{ if (lower .Name | findRE "\\.(gif|jpg|jpeg|tiff|png|bmp|webp|avif|jxl)") }}
|
|
|
|
{{ $images = $images | append . }}
|
2023-04-04 18:34:22 +02:00
|
|
|
{{ end }}
|
2023-04-05 14:16:33 +02:00
|
|
|
{{ end }}
|
2023-12-12 18:56:08 +01:00
|
|
|
<div class="carousel-indicators mb-0">
|
|
|
|
{{ range $index, $image := $images }}
|
|
|
|
<button type="button mb-5" data-bs-target="#slider-{{ md5 $dir }}" data-bs-slide-to="{{ $index }}" {{ if eq $index 0 }}class="active"{{ end }}></button>
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
<div class="carousel-inner mb-0">
|
|
|
|
{{ range $index, $image := $images }}
|
|
|
|
<div class="carousel-item mb-0 {{ if eq $index 0 }}active{{end}}">
|
|
|
|
<img src='{{ print $.Site.BaseURL $dir "/" $image.Name | absURL }}' class="d-block w-100 mb-0 rounded-3">
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
2023-04-05 14:16:33 +02:00
|
|
|
<button class="carousel-control-prev mb-0" type="button" data-bs-target="#slider-{{ md5 $dir }}" data-bs-slide="prev">
|
|
|
|
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
|
|
|
|
<span class="visually-hidden">Zurück</span>
|
|
|
|
</button>
|
|
|
|
<button class="carousel-control-next mb-0" type="button" data-bs-target="#slider-{{ md5 $dir }}" data-bs-slide="next">
|
|
|
|
<span class="carousel-control-next-icon" aria-hidden="true"></span>
|
|
|
|
<span class="visually-hidden">Vor</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
2023-12-12 18:56:08 +01:00
|
|
|
</div>
|
|
|
|
{{ end }}
|