From b155e7a25a3e9cf8f5470ccbb228c3e5c6492c22 Mon Sep 17 00:00:00 2001 From: pastalian Date: Fri, 15 Nov 2019 14:52:59 +0900 Subject: [PATCH] Prevent to load swiper when param is not set --- layouts/partials/header/site-header.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/layouts/partials/header/site-header.html b/layouts/partials/header/site-header.html index c95cf66..67b149e 100644 --- a/layouts/partials/header/site-header.html +++ b/layouts/partials/header/site-header.html @@ -1,23 +1,24 @@ {{ if .IsHome }}
+ {{ if .Site.Params.swiperCount }}
- {{ if .Site.Params.swiperCount }} {{ range $idx, $seq := (seq .Site.Params.swiperCount) }}
{{ partial (print "header/slide-" $seq) . }}
{{ end }} - {{ end }}
+ {{ end }}
+{{ if .Site.Params.swiperCount }} @@ -27,5 +28,6 @@ var mySwiper = new Swiper('.swiper-container', options); +{{ end }} {{ end }} \ No newline at end of file