I needed to use .PrevInSection to traverse posts, as it traverses in date order, not in the same sort order that I have displayed the content in
My links were going on reverse order of my set weights (ok, im now using prev to go to next… weird but ok)
So i guess is how to adjust weights for NextPage.
i have weights on frontmatter and on menu in config.toml.
Does it go by section weight > page weight? Does frontmatter or config.toml take precedence?
{{ define "main" }}
{{ range .Paginator.Pages }}
<article>
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
{{ .Content }}
</article>
{{ end }}
{{ template "_internal/pagination.html" . }}
{{ end }}
im inserting the next/prev on the footer of the single layout. does that help? im not really sure where you were going as this isnt being used inside a range.
Where I’m going: The values of .NextInSection and .PrevInSection depend on how your pages are ordered. Based off your list template, you’re not explicitly setting the order, so it falls back to the default page order of .ByWeight.
it makes sense IN SECTION, but if i use nextpage it goes cross-section?
Doing some tests here and it seems that was the issue. gonna try increase all pages weight regardless of section
Interesting post. I’ve found something weird too (which has just changed between 0.56.1 and 0.56.3).
I have a section with 3 pages. Each page has a weight (10, 20, 30). Date doesn’t exist (to avoid order conflicts with published date).
Now, the template has:
My expectation is to see (page weight in brackets)
page1(30) with next to page2(20)
page2(20) with next to page3(10) and prev to page1(30)
page3(10) with prev to page2(20)
What I get is:
page1(30) has a prev to page2(20) and a next to page3(10)
page2(20) has a next to page1(30)
page3(10) has a prev to page2(20) and a next to page1(30)
Now, I’ve made some test, but I cannot explain:
Why page2(20) doesn’t have a PrevInSection
Why page3(10) and page1(30) generate a circular reference
I’ve tried to make page1(10) and page3(30), considering to reverse the order, but what I got was not different.
Am I doing anything wrong? (probably yes)