mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-26 22:04:32 +02:00
Add in-section Next/Prev content pointers
Conflicts: docs/content/meta/release-notes.md docs/content/templates/variables.md
This commit is contained in:
@@ -724,6 +724,15 @@ func (s *Site) assembleSections() {
|
||||
|
||||
for k := range s.Sections {
|
||||
s.Sections[k].Sort()
|
||||
|
||||
for i, wp := range s.Sections[k] {
|
||||
if i > 0 {
|
||||
wp.Page.NextInSection = s.Sections[k][i - 1].Page;
|
||||
}
|
||||
if i < len(s.Sections[k]) - 1 {
|
||||
wp.Page.PrevInSection = s.Sections[k][i + 1].Page;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user