Make string sorting (e.g. ByTitle, ByLinkTitle and ByParam) language aware

Fixes #2180
This commit is contained in:
Bjørn Erik Pedersen
2022-04-10 20:30:52 +02:00
parent 82ba634ed9
commit 627eed1d62
11 changed files with 297 additions and 31 deletions

View File

@@ -19,6 +19,8 @@ import (
"testing"
"github.com/gohugoio/hugo/common/maps"
"github.com/gohugoio/hugo/config"
"github.com/gohugoio/hugo/langs"
"github.com/gohugoio/hugo/deps"
)
@@ -28,7 +30,9 @@ type stringsSlice []string
func TestSort(t *testing.T) {
t.Parallel()
ns := New(&deps.Deps{})
ns := New(&deps.Deps{
Language: langs.NewDefaultLanguage(config.New()),
})
type ts struct {
MyInt int