slider.html 2.6 KB

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