47 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
			
		
		
	
	
			47 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
| {{ if $.Params.header }}
 | |
| <div class="swiper-container">
 | |
|   <div class="swiper-wrapper">
 | |
|   {{ 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 }}
 | |
|     {{ end }}
 | |
|   {{ end }}
 | |
|   </div>
 | |
|   <div class="swiper-pagination"></div>
 | |
| </div>
 | |
| {{ end }}
 | |
| 
 | |
| {{ $js := .Site.Data.lib.js }}
 | |
| {{ $css := .Site.Data.lib.css }}
 | |
| 
 | |
| <link rel="stylesheet" href="{{  $css.swiper.url }}" integrity="{{ $css.swiper.sri }}" crossorigin="anonymous">
 | |
| <script src="{{ $js.swiper.url }}" integrity="{{ $js.swiper.sri }}" crossorigin="anonymous"></script>
 | |
| 
 | |
| <script>
 | |
|   {{ $swiper := .Site.Data.swiper }}
 | |
|   var options = JSON.parse({{ $swiper | jsonify }});
 | |
| 
 | |
|   var mySwiper = new Swiper('.swiper-container', options);
 | |
| </script> |