remove home page all language support that may cause trouble

it can cause the search page to have a redundant result for each page
This commit is contained in:
Reorx 2022-05-19 18:57:42 +08:00
parent 6159f68a27
commit 84ac59ce9d
1 changed files with 1 additions and 7 deletions

View File

@ -28,13 +28,7 @@
{{- $pages := .Pages }} {{- $pages := .Pages }}
{{- if .IsHome }} {{- if .IsHome }}
{{/* first language is the main language, get all pages */}} {{- $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
{{- 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 }} {{- end }}
{{/* related issue: https://github.com/gohugoio/hugo/issues/9003 */}} {{/* related issue: https://github.com/gohugoio/hugo/issues/9003 */}}