hugolib: Formally deprecate .Page.NextPage .Page.PrevPage

Use .Page.Next and .Page.Prev instead.
This commit is contained in:
Joe Mooring 2024-02-03 08:01:56 -08:00 committed by Bjørn Erik Pedersen
parent b72f909725
commit 7f82461407

View file

@ -16,6 +16,7 @@ package hugolib
import ( import (
"context" "context"
"github.com/gohugoio/hugo/common/hugo"
"github.com/gohugoio/hugo/lazy" "github.com/gohugoio/hugo/lazy"
"github.com/gohugoio/hugo/resources/page" "github.com/gohugoio/hugo/resources/page"
) )
@ -52,7 +53,9 @@ func (p pagePosition) Next() page.Page {
return p.next() return p.next()
} }
// Deprecated: Use Next instead.
func (p pagePosition) NextPage() page.Page { func (p pagePosition) NextPage() page.Page {
hugo.Deprecate(".Page.NextPage", "Use .Page.Next instead.", "v0.123.0")
return p.Next() return p.Next()
} }
@ -60,7 +63,9 @@ func (p pagePosition) Prev() page.Page {
return p.prev() return p.prev()
} }
// Deprecated: Use Prev instead.
func (p pagePosition) PrevPage() page.Page { func (p pagePosition) PrevPage() page.Page {
hugo.Deprecate(".Page.PrevPage", "Use .Page.Prev instead.", "v0.123.0")
return p.Prev() return p.Prev()
} }