aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/site.go
diff options
context:
space:
mode:
Diffstat (limited to 'hugolib/site.go')
-rw-r--r--hugolib/site.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/hugolib/site.go b/hugolib/site.go
index bbf110d1d..a93bbdbe6 100644
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -117,6 +117,9 @@ func (s *Site) prepareInits() {
s.init.prevNext = init.Branch(func(context.Context) (any, error) {
regularPages := s.RegularPages()
+ if s.conf.Page.NextPrevSortOrder == "asc" {
+ regularPages = regularPages.Reverse()
+ }
for i, p := range regularPages {
np, ok := p.(nextPrevProvider)
if !ok {
@@ -181,7 +184,11 @@ func (s *Site) prepareInits() {
)
for _, section := range sections {
- setNextPrev(section.RegularPages())
+ ps := section.RegularPages()
+ if s.conf.Page.NextPrevInSectionSortOrder == "asc" {
+ ps = ps.Reverse()
+ }
+ setNextPrev(ps)
}
return nil, nil