mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
cc2ef7bf70
- Add enableTranslationMerge parameter to control translation merging - Default to false for better performance, especially for single-language sites - Update comments to reflect the new default behavior - Implement conditional translation merging in global.html" - Add enableTranslationMerge parameter to control translation merging - Default to false for better performance, especially for single-language sites - Update comments to reflect the new default behavior - Implement conditional translation merging in global.html" > [!NOTE] > This won't create new pages, if you need empty placeholder pages, you might need [shortcode-missing-translation](https://github.com/hugo-fixit/shortcode-missing-translation).
21 lines
818 B
HTML
21 lines
818 B
HTML
{{- $pages := .Site.RegularPages }}
|
|
|
|
{{- /* Merge missing translations from other languages */ -}}
|
|
{{- if .Site.Params.enableTranslationMerge -}}
|
|
{{- range .Site.Home.Translations -}}
|
|
{{- $pages = $pages | lang.Merge .Site.RegularPages -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{- /* Set pages of main sections */ -}}
|
|
{{- $pages = where $pages "Section" "in" .Site.MainSections -}}
|
|
{{- $pages = $pages | union (where .Site.RegularPages "Type" "in" .Site.MainSections) -}}
|
|
{{- .Site.Store.Set "mainSectionPages" $pages -}}
|
|
|
|
{{- /* Select the scope named `public_repo` to generate personal access token */ -}}
|
|
{{- $header := dict "Authorization" "" -}}
|
|
{{- with (getenv "HUGO_PARAMS_GHTOKEN") -}}
|
|
{{- $header = dict "Authorization" (printf "token %v" .) -}}
|
|
{{- end -}}
|
|
{{- hugo.Store.Set "githubTokenHeader" $header -}}
|