mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-29 17:52:38 +00:00
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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user