hugo-theme-moments/layouts/partials/pic_set.html
2021-08-05 13:38:08 +08:00

33 lines
No EOL
1.3 KiB
HTML

<!-- START -->
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
{{range $num,$a := .pic_set}}
{{if eq $num 0 }}
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
{{ else }}
<li data-target="#carouselExampleIndicators" data-slide-to="{{$num}}"></li>
{{ end }}
{{end}}
</ol>
<div class="carousel-inner">
{{range $num,$a := .pic_set}}
{{if eq $num 0 }}
<div class="carousel-item active">
<img src="{{$a}}" class="d-block w-100 pic-in-set" alt="{{add $num 1}}">
</div>
{{else}}
<div class="carousel-item">
<img src="{{$a}}" class="d-block w-100 pic-in-set" alt="{{add $num 1}}">
</div>
{{end}}
{{end}}
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>