From 4dcf7c7092fe30482217156972215c9e16160273 Mon Sep 17 00:00:00 2001 From: Anthony Fok Date: Tue, 1 May 2018 10:43:11 -0600 Subject: [PATCH] Fix "reflect: Zero(nil)" error in showcase when a showcase bundle does not yet exist for a new language, for when our website goes multilingual. Special thanks to @bep for the suggested fix. See #461 Fixes gohugoio/gohugoioTheme#90 --- .../layouts/partials/home-page-sections/showcase.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/themes/gohugoioTheme/layouts/partials/home-page-sections/showcase.html b/themes/gohugoioTheme/layouts/partials/home-page-sections/showcase.html index 774c10e0f..c73cfa5e9 100644 --- a/themes/gohugoioTheme/layouts/partials/home-page-sections/showcase.html +++ b/themes/gohugoioTheme/layouts/partials/home-page-sections/showcase.html @@ -5,10 +5,12 @@
{{ $showcasePages := where .Site.RegularPages "Section" "showcase" }} + {{ if $showcasePages }} {{ template "home_showcase_item" (index $showcasePages 0) }} {{ range $p := first 10 ($showcasePages | after 1 | shuffle) }} {{template "home_showcase_item" $p }} {{end}} + {{end}}