2019-11-18 12:14:32 +00:00
|
|
|
{{ if $.Params.header }}
|
2019-11-15 08:37:32 +00:00
|
|
|
<div class="swiper-container">
|
|
|
|
<div class="swiper-wrapper">
|
2019-11-18 12:14:32 +00:00
|
|
|
{{ range $.Params.header }}
|
|
|
|
{{ if eq .type "slide" }}
|
|
|
|
{{ $height := .height }}
|
|
|
|
{{ range .slide }}
|
|
|
|
<div class="swiper-slide custom-header custom-header__align-{{ .align }}" style="background-image: url('{{.image | relURL }}'); height: {{ $height }}px;">
|
|
|
|
{{ $header := . }}
|
|
|
|
{{ if .title }}
|
|
|
|
{{ range .title }}
|
|
|
|
<div class="custom-header__title" style="font-size: {{ $header.titleFontSize }}px; padding: {{ $header.paddingY }}px {{ $header.paddingX }}px;">
|
|
|
|
{{ . }}
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ if .spaceBetweenTitleSubtitle }}
|
|
|
|
<div style="height: {{ .spaceBetweenTitleSubtitle }}px"></div>
|
|
|
|
{{ end }}
|
|
|
|
{{ if .subtitle }}
|
|
|
|
{{ range .subtitle }}
|
|
|
|
<div class="custom-header__subtitle" style="font-size: {{ $header.subtitleFontSize }}px; padding: {{ $header.paddingY }}px {{ $header.paddingX }}px;">
|
|
|
|
{{ . }}
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
2019-11-15 08:37:32 +00:00
|
|
|
{{ end }}
|
2019-11-18 12:14:32 +00:00
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
<div class="swiper-pagination"></div>
|
|
|
|
</div>
|
|
|
|
{{ else }}
|
|
|
|
<div class="swiper-container">
|
|
|
|
<div class="swiper-wrapper">
|
|
|
|
{{ range $idx, $seq := (seq 3) }}
|
|
|
|
<div class="swiper-slide">
|
|
|
|
{{ partial (print "header/slide-" $seq) . }}
|
|
|
|
</div>
|
2019-11-15 08:37:32 +00:00
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
<div class="swiper-pagination"></div>
|
2019-11-17 11:01:09 +00:00
|
|
|
</div>
|
2019-11-18 12:14:32 +00:00
|
|
|
{{ end }}
|
2019-11-17 11:01:09 +00:00
|
|
|
|
|
|
|
{{ $js := .Site.Data.lib.js }}
|
|
|
|
{{ $css := .Site.Data.lib.css }}
|
|
|
|
|
|
|
|
{{ printf "<link rel=\"stylesheet\" href=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\">" $css.swiper.url $css.swiper.sri | safeHTML }}
|
|
|
|
{{ printf "<script src=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\" title=\"swiper\"></script>" $js.swiper.url $js.swiper.sri | safeHTML }}
|
|
|
|
|
|
|
|
<script>
|
2019-11-18 12:14:32 +00:00
|
|
|
{{ $swiper := .Site.Data.swiper }}
|
2019-11-17 11:01:09 +00:00
|
|
|
var options = JSON.parse({{ $swiper | jsonify }});
|
|
|
|
|
|
|
|
var mySwiper = new Swiper('.swiper-container', options);
|
|
|
|
</script>
|