diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2025-02-26 12:16:58 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2025-02-26 13:06:26 +0100 |
commit | c498d0fe1e982f59d314627878ef9b744240268d (patch) | |
tree | 30f8cab9e092c52b95b8269526a0ffbd50d2db63 /common | |
parent | 521911a576af0091c9d07bb546e474bf98341b7f (diff) | |
download | hugo-c498d0fe1e982f59d314627878ef9b744240268d.tar.gz hugo-c498d0fe1e982f59d314627878ef9b744240268d.zip |
Use the page path and not the backing filename as the last resort in the default sort
This should:
1. Fix some (rare) tiebreaker issues when sorting pages from multiple content adapters.
2. Improve the sorting for pages without a backing file.
Diffstat (limited to 'common')
-rw-r--r-- | common/paths/pathparser_test.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/common/paths/pathparser_test.go b/common/paths/pathparser_test.go index e8fee96e1..584b1a78a 100644 --- a/common/paths/pathparser_test.go +++ b/common/paths/pathparser_test.go @@ -165,6 +165,7 @@ func TestParse(t *testing.T) { c.Assert(p.Identifiers(), qt.DeepEquals, []string{"txt", "no"}) c.Assert(p.Base(), qt.Equals, "/a/b.a.b.txt") c.Assert(p.BaseNoLeadingSlash(), qt.Equals, "a/b.a.b.txt") + c.Assert(p.Path(), qt.Equals, "/a/b.a.b.no.txt") c.Assert(p.PathNoLang(), qt.Equals, "/a/b.a.b.txt") c.Assert(p.Ext(), qt.Equals, "txt") c.Assert(p.PathNoIdentifier(), qt.Equals, "/a/b.a.b") @@ -220,6 +221,7 @@ func TestParse(t *testing.T) { c.Assert(p.NameNoExt(), qt.Equals, "index.no") c.Assert(p.NameNoIdentifier(), qt.Equals, "index") c.Assert(p.NameNoLang(), qt.Equals, "index.md") + c.Assert(p.Path(), qt.Equals, "/a/b/index.no.md") c.Assert(p.PathNoLang(), qt.Equals, "/a/b/index.md") c.Assert(p.Section(), qt.Equals, "a") }, |