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
This commit is contained in:
Anthony Fok
2018-05-01 10:43:11 -06:00
parent 63dd255054
commit 4dcf7c7092
@@ -5,10 +5,12 @@
<div class="w-100 overflow-x-scroll">
<div class="row nowrap mv2 pb1">
{{ $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}}
</div>
</div>
</div>