diff options
| author | Reorx <novoreorx@gmail.com> | 2022-04-22 15:57:25 +0800 |
|---|---|---|
| committer | Reorx <novoreorx@gmail.com> | 2022-04-22 15:57:25 +0800 |
| commit | 0654046820c339c82e95ad606486cea5be907315 (patch) | |
| tree | 88e7c552de891c6a3e19bf1bb79a3f023751d9ba /layouts/_default | |
| parent | 8deaaf2d048facf4fe8e8f8c5927af2a1a169b5d (diff) | |
show all pages for first language
Diffstat (limited to 'layouts/_default')
| -rw-r--r-- | layouts/_default/list.html | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 01f2a62..9bd0e96 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -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 */}} |
