From 1af54bd807987d5d7000c039e5409bacd3378283 Mon Sep 17 00:00:00 2001 From: Guillermo Guerrero Date: Fri, 30 Sep 2022 15:17:48 +0200 Subject: [PATCH] Not fail when folders doesn't exist. (#371) --- layouts/partials/carousel.html | 2 ++ layouts/partials/clients.html | 2 ++ layouts/partials/features.html | 2 ++ layouts/partials/testimonials.html | 2 ++ 4 files changed, 8 insertions(+) diff --git a/layouts/partials/carousel.html b/layouts/partials/carousel.html index 5d0e42b84..e3b25c56e 100644 --- a/layouts/partials/carousel.html +++ b/layouts/partials/carousel.html @@ -1,4 +1,5 @@ {{ if default true .Site.Params.CarouselHomepage.enable }} +{{ if isset .Site.Data "carousel" }} {{ if gt (len .Site.Data.carousel) 0 }}
{{ end }} {{ end }} +{{ end }} diff --git a/layouts/partials/clients.html b/layouts/partials/clients.html index 00583f348..3608e5e14 100644 --- a/layouts/partials/clients.html +++ b/layouts/partials/clients.html @@ -1,5 +1,6 @@ {{ if isset .Site.Params "clients" }} {{ if .Site.Params.clients.enable }} +{{ if isset .Site.Data "clients" }} {{ if gt (len .Site.Data.clients) 0 }}
@@ -38,3 +39,4 @@

{{ .Site.Params.clients.title | markdownify }}

{{ end }} {{ end }} {{ end }} +{{ end }} diff --git a/layouts/partials/features.html b/layouts/partials/features.html index ea73ac502..d370d3eab 100644 --- a/layouts/partials/features.html +++ b/layouts/partials/features.html @@ -1,5 +1,6 @@ {{ if isset .Site.Params "features" }} {{ if .Site.Params.features.enable }} +{{ if isset .Site.Data "features" }} {{ if gt (len .Site.Data.features) 0 }}
@@ -44,3 +45,4 @@

{{ $element.name | markdownify }}

{{ end }} {{ end }} {{ end }} +{{ end }} diff --git a/layouts/partials/testimonials.html b/layouts/partials/testimonials.html index a14b3b6ba..c6af78207 100644 --- a/layouts/partials/testimonials.html +++ b/layouts/partials/testimonials.html @@ -1,5 +1,6 @@ {{ if isset .Site.Params "testimonials" }} {{ if .Site.Params.testimonials.enable }} +{{ if isset .Site.Data "testimonials" }} {{ if gt (len .Site.Data.testimonials) 0 }}
@@ -51,3 +52,4 @@
{{ .name }}
{{ end }} {{ end }} {{ end }} +{{ end }}