-
Notifications
You must be signed in to change notification settings - Fork 3
/
carousel.html
18 lines (18 loc) · 906 Bytes
/
carousel.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{{ .Scratch.Set "height" (.Get "height") }}
{{ .Scratch.Set "unit" (.Get "unit") }}
{{ .Scratch.Set "ordinal" .Ordinal }}
{{ .Scratch.Set "items" (.Get "items") }}
<div id="carousel{{ .Ordinal }}" class="carousel" duration="{{ .Get `duration` }}">
<ul>
{{ range $index, $slide := .Site.Data.carousel.images }}
<li id="c{{ $.Scratch.Get "ordinal" }}_slide{{ add $index 1}}" style="min-width: calc(100%/{{ $.Scratch.Get "items" }}); padding-bottom: {{ $.Scratch.Get "height" }}{{ $.Scratch.Get "unit" }};"><img src="{{ $slide.image }}" alt="" /><div><div>{{ $slide.content_html }}</div></div></li>
{{ end }}
</ul>
<ol>
{{ range $index, $page := .Site.Data.carousel.images }}
<li><a href="#c{{ $.Scratch.Get "ordinal" }}_slide{{ add $index 1 }}"></a></li>
{{ end }}
</ol>
<div class="prev">‹</div>
<div class="next">›</div>
</div>