Skip to content

Commit

Permalink
hugolib: Formally deprecate .Page.NextPage .Page.PrevPage
Browse files Browse the repository at this point in the history
Use .Page.Next and .Page.Prev instead.
  • Loading branch information
jmooring authored and bep committed Feb 3, 2024
1 parent b72f909 commit 7f82461
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hugolib/page__position.go
Expand Up @@ -16,6 +16,7 @@ package hugolib
import (
"context"

"github.com/gohugoio/hugo/common/hugo"
"github.com/gohugoio/hugo/lazy"
"github.com/gohugoio/hugo/resources/page"
)
Expand Down Expand Up @@ -52,15 +53,19 @@ func (p pagePosition) Next() page.Page {
return p.next()
}

// Deprecated: Use Next instead.
func (p pagePosition) NextPage() page.Page {
hugo.Deprecate(".Page.NextPage", "Use .Page.Next instead.", "v0.123.0")
return p.Next()
}

func (p pagePosition) Prev() page.Page {
return p.prev()
}

// Deprecated: Use Prev instead.
func (p pagePosition) PrevPage() page.Page {
hugo.Deprecate(".Page.PrevPage", "Use .Page.Prev instead.", "v0.123.0")
return p.Prev()
}

Expand Down

0 comments on commit 7f82461

Please sign in to comment.