You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(allconfig.Configs).Init builds (allconfig.Configs).LanguageConfigSlice by appending one element per language in an indeterminate order. Then it appends to the slice again, one element per language sorted by language weight.
So this site configuration:
[languages.en]
title = 'TITLE_EN'
weight = 2
[languages.de]
title = 'TITLE_DE'
weight = 1
[languages.fr]
title = 'TITLE_FR'
weight = 3
...results in a slice with too many elements, ordered like this:
[en de fr de en fr]
--------
indeterminate order
We only want the last three so that (allconfig.Configs).LanguageConfigSlice[0] returns the config with the lowest weight.
I looked at our usage of this slice, and from a practical standpoint I think it only affects the output from the hugo config command, and even then only under certain conditions.
Found while addressing #13199.
(allconfig.Configs).Init
builds(allconfig.Configs).LanguageConfigSlice
by appending one element per language in an indeterminate order. Then it appends to the slice again, one element per language sorted by language weight.So this site configuration:
...results in a slice with too many elements, ordered like this:
We only want the last three so that
(allconfig.Configs).LanguageConfigSlice[0]
returns the config with the lowest weight.I looked at our usage of this slice, and from a practical standpoint I think it only affects the output from the
hugo config
command, and even then only under certain conditions.But we should fix this anyway.
https://github.com/gohugoio/hugo/blob/master/config/allconfig/allconfig.go#L750-L775
The text was updated successfully, but these errors were encountered: