/
hero_carousel.html
61 lines (54 loc) · 2.57 KB
/
hero_carousel.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{{ $ := .root }}
{{ $page := .page }}
<section id="{{ $page.File.TranslationBaseName }}" class="carousel slide" data-ride="carousel" data-interval="{{if isset $page.Params "interval"}}{{$page.Params.interval}}{{else}}5000{{end}}">
<!-- Indicators -->
<ol class="carousel-indicators">
{{ range $index, $item := $page.Params.item }}
<li data-target="#{{ $page.File.TranslationBaseName }}" data-slide-to="{{ $index }}" {{ if eq $index 0 }}class="active"{{ end }}></li>
{{ end }}
</ol>
<!-- Carousel slides wrapper -->
<div class="carousel-inner" style="min-height: {{$page.Params.height | default "300px"}};">
{{ range $index, $item := $page.Params.item }}
<div class="hero-overlay carousel-item{{ if eq $index 0 }} active{{ end }}" style="min-height: inherit;
{{ if $item.overlay_color }}
background-color: {{ $item.overlay_color | default "transparent" }};
{{ end }}
{{ if $item.overlay_img }}
background-image:
{{ if $item.overlay_filter }}linear-gradient(rgba(0, 0, 0, {{ $item.overlay_filter }}), rgba(0, 0, 0, {{ $item.overlay_filter }})), {{ end }}
url('{{ printf "img/%s" $item.overlay_img | relURL }}');
{{ end }}
;">
<div class="container" style="text-align: {{$item.align | default "left"}};">
<h1 class="hero-title" itemprop="headline">
{{ with $item.title }}{{ . | markdownify | emojify }}{{ end }}
</h1>
{{ with $item.content }}
<p class="hero-lead" style="{{if eq $item.align "center"}}margin: 0 auto 0 auto;{{else if eq $item.align "right"}}margin-left: auto; margin-right: 0{{end}}">
{{ . | markdownify | emojify }}
</p>
{{ end }}
{{ if $item.cta_url }}
{{ $pack := or .icon_pack "fa" }}
<p>
<a href="{{ $item.cta_url }}" class="btn btn-outline-light btn-lg">
{{- with $item.cta_icon -}}<i class="{{ $pack }} {{ $pack }}-{{ . }}" style="padding-right: 10px;"></i>{{- end -}}
{{- $item.cta_label | emojify | safeHTML -}}
</a>
</p>
{{ end }}
</div>
</div>
{{ end }}
</div>
<!-- Left and right controls -->
<a class="carousel-control-prev" href="#{{ $page.File.TranslationBaseName }}" data-slide="prev">
<span class="carousel-control-prev-icon"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#{{ $page.File.TranslationBaseName }}" data-slide="next">
<span class="carousel-control-next-icon"></span>
<span class="sr-only">Next</span>
</a>
</section>