.Page.Prev deprecated but .Page.Next is not?

Reading through the Page Variables documentation it seems that .Prev is deprecated, but .Next is not. Is this an error in documentation or do I miss something that makes .Next required?

2 Likes

Merely your perception of the passage of time.

Sorry, that’s not helpful, it’s just fun to read your question literally. :slight_smile:

1 Like

I am wondering the same thing. How can .Prev be deprecated but not .Next? What should you use instead of .Prev anyway?

1 Like

Yes, very funny

use .NextInSection and .PrevInSection

I have fixed the docs. Prev/Next is NOT deprecated and I just fixed the docs. There is a story to be told here, but I don’t have time right now.

2 Likes

Thank you for the clarification :slight_smile:

The documentation at https://gohugo.io/variables/page/#page-variables now says:

.Next
Pointer to the next regular page (sorted by Hugo’s default sort). Example: {{if .NextPage}}{{.NextPage.Permalink}}{{end}}

I am wondering if I should use .Next or .NextPage and if the docs should be edited so that .Next and .NextPage are both documented?

Thanks for any more clarification about this!

PS - I think the “story to be told” that @bep mentioned is in https://github.com/gohugoio/hugo/issues/1061

PPS - And of course it would be useful to also document .Prev and .PrevPage