mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 00:16:45 +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:
1 file changed
+2
@@ -5,10 +5,12 @@
|
|||||||
<div class="w-100 overflow-x-scroll">
|
<div class="w-100 overflow-x-scroll">
|
||||||
<div class="row nowrap mv2 pb1">
|
<div class="row nowrap mv2 pb1">
|
||||||
{{ $showcasePages := where .Site.RegularPages "Section" "showcase" }}
|
{{ $showcasePages := where .Site.RegularPages "Section" "showcase" }}
|
||||||
|
{{ if $showcasePages }}
|
||||||
{{ template "home_showcase_item" (index $showcasePages 0) }}
|
{{ template "home_showcase_item" (index $showcasePages 0) }}
|
||||||
{{ range $p := first 10 ($showcasePages | after 1 | shuffle) }}
|
{{ range $p := first 10 ($showcasePages | after 1 | shuffle) }}
|
||||||
{{template "home_showcase_item" $p }}
|
{{template "home_showcase_item" $p }}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in new issue
Block a user