mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-02-02 11:32:30 -06:00
Add dynamically generated ID
This commit is contained in:
parent
4a34e5076a
commit
ffa0ece618
1 changed files with 7 additions and 4 deletions
|
@ -1,10 +1,13 @@
|
||||||
<div id="carouselExampleCaptions" class="carousel slide relative" data-bs-ride="carousel">
|
{{ $time := now.UnixNano }}
|
||||||
|
{{ $id := delimit (slice "gallery" $time) "-" }}
|
||||||
|
|
||||||
|
<div id="{{ $id }}" class="carousel slide relative" data-bs-ride="carousel">
|
||||||
<div class="carousel-indicators absolute right-0 bottom-0 left-0 flex justify-center p-0 mb-2">
|
<div class="carousel-indicators absolute right-0 bottom-0 left-0 flex justify-center p-0 mb-2">
|
||||||
|
|
||||||
{{ $num := 0 }}
|
{{ $num := 0 }}
|
||||||
{{ range .Params }}
|
{{ range .Params }}
|
||||||
|
|
||||||
<button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="{{ $num }}"
|
<button type="button" data-bs-target="#{{ $id }}" data-bs-slide-to="{{ $num }}"
|
||||||
{{ if eq $num 0 }} class="active" aria-current="true" {{ end }} aria-label="Slide {{ $num }}"></button>
|
{{ if eq $num 0 }} class="active" aria-current="true" {{ end }} aria-label="Slide {{ $num }}"></button>
|
||||||
|
|
||||||
{{ $num = add $num 1 }}
|
{{ $num = add $num 1 }}
|
||||||
|
@ -25,13 +28,13 @@
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
class="carousel-control-prev absolute top-0 bottom-0 flex items-center justify-center p-0 text-center border-0 hover:outline-none hover:no-underline focus:outline-none focus:no-underline left-0"
|
class="carousel-control-prev absolute top-0 bottom-0 flex items-center justify-center p-0 text-center border-0 hover:outline-none hover:no-underline focus:outline-none focus:no-underline left-0"
|
||||||
type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide="prev">
|
type="button" data-bs-target="#{{ $id }}" data-bs-slide="prev">
|
||||||
<span class="carousel-control-prev-icon inline-block bg-no-repeat" aria-hidden="true"></span>
|
<span class="carousel-control-prev-icon inline-block bg-no-repeat" aria-hidden="true"></span>
|
||||||
<span class="visually-hidden">Previous</span>
|
<span class="visually-hidden">Previous</span>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="carousel-control-next absolute top-0 bottom-0 flex items-center justify-center p-0 text-center border-0 hover:outline-none hover:no-underline focus:outline-none focus:no-underline right-0"
|
class="carousel-control-next absolute top-0 bottom-0 flex items-center justify-center p-0 text-center border-0 hover:outline-none hover:no-underline focus:outline-none focus:no-underline right-0"
|
||||||
type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide="next">
|
type="button" data-bs-target="#{{ $id }}" data-bs-slide="next">
|
||||||
<span class="carousel-control-next-icon inline-block bg-no-repeat" aria-hidden="true"></span>
|
<span class="carousel-control-next-icon inline-block bg-no-repeat" aria-hidden="true"></span>
|
||||||
<span class="visually-hidden">Next</span>
|
<span class="visually-hidden">Next</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
Loading…
Reference in a new issue