diff options
Diffstat (limited to 'resources/page/pages_sort.go')
-rw-r--r-- | resources/page/pages_sort.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/resources/page/pages_sort.go b/resources/page/pages_sort.go index 08cb34a32..b9b905cc2 100644 --- a/resources/page/pages_sort.go +++ b/resources/page/pages_sort.go @@ -14,6 +14,7 @@ package page import ( + "context" "sort" "github.com/gohugoio/hugo/common/collections" @@ -299,7 +300,7 @@ func (p Pages) ByLastmod() Pages { // Adjacent invocations on the same receiver will return a cached result. // // This may safely be executed in parallel. -func (p Pages) ByLength() Pages { +func (p Pages) ByLength(ctx context.Context) Pages { const key = "pageSort.ByLength" length := func(p1, p2 Page) bool { @@ -314,7 +315,7 @@ func (p Pages) ByLength() Pages { return false } - return p1l.Len() < p2l.Len() + return p1l.Len(ctx) < p2l.Len(ctx) } pages, _ := spc.get(key, pageBy(length).Sort, p) |