show all pages for first language

This commit is contained in:
Reorx 2022-04-22 15:57:25 +08:00
parent 8deaaf2d04
commit 0654046820
1 changed files with 8 additions and 1 deletions

View File

@ -24,10 +24,17 @@
</div>
{{- end }}
{{- $pages := .Pages }}
{{- if .IsHome }}
{{- $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
{{/* first language is the main language, get all pages */}}
{{- if (eq site.Language (index site.Languages 0)) }}
{{- $pages = where site.AllPages "Kind" "page" }}
{{- else }}
{{- $pages = site.RegularPages }}
{{- end }}
{{- $pages = where $pages "Type" "in" site.Params.mainSections }}
{{- end }}
{{/* related issue: https://github.com/gohugoio/hugo/issues/9003 */}}