Welcome to mirror list, hosted at ThFree Co, Russian Federation.

slider.html « partials « layouts - github.com/balaramadurai/hugo-travelify-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2a4909d3f5278873eaae8ab5de14fabac192cebc (plain)
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
{{ if isset .Site.Params "slider" }}
{{ if .Site.Params.slider.enable }}

<section class="featured-slider">
    <div class="slider-cycle">
	{{ if gt (len .Site.Data.slider) 0 }}
	{{ range $index, $slide := .Site.Data.slider }}
	{{ if and (isset $slide "banner") (not (eq .banner "")) }}
	<div class="slides {{ if eq $index 0 }} displayblock {{ else }} displaynone {{ end }}">
	    <figure>
		<a href="{{ .url }}" title="{{ .Title }}">
		    <img src="{{ .banner }}" class="pngfix wp-post-image" alt="{{ .Title }}" title="{{ .Title }}">
		</a>
	    </figure>
	    <article class="featured-text">
		<div class="featured-title">
		    <a href="{{ .Permalink }}" title="{{ .Title }}">{{ .Title }}</a>
		</div><!-- .featured-title -->
		<div class="featured-content">{{ printf "%s" .Summary | markdownify }}
		</div><!-- .featured-content -->
	    </article><!-- .featured-text -->
	</div><!-- .slides -->
	{{ end }}
	{{ end }}
	{{ end }}
	
	{{ if and (isset .Site.Params.slider "manual") (.Site.Params.slider.manual) }}
	{{ range $index, $page := .Site.Pages.ByParam "slider" }}
	{{ if and (isset .Params "banner") (not (eq .Params.banner "")) }}
	{{ if and (isset .Params "slider") (.Params.slider) }}
	<div class="slides {{ if eq $index 0 }} displayblock {{ else }} displaynone {{ end }}">
	    {{ partial "single_slide" . }}
	</div><!-- .slides -->
	{{ end }}
	{{ end }}
	{{ end }}
	{{ else }}
	{{ $features := add .Site.Params.slider.num_features 1 }}
	{{ range $index, $page := first $features (where .Site.Pages "Type" "post") }}
	{{ if and (isset .Params "banner") (not (eq .Params.banner "")) }}
	<div class="slides {{ if eq $index 0 }} displayblock {{ else }} displaynone {{ end }}">
	    {{ partial "single_slide" . }}
	</div><!-- .slides -->
	{{ end }}
	{{ end }}
	{{ end }}
  </div>
  <nav id="controllers" class="clearfix">
  </nav>
  <!-- #controllers -->
</section><!-- .featured-slider -->		
{{ end }}
{{ end }}