Shifting the order of menus

I have a unique use case whereby I need to display a menu with a different starting item (next page) for each page. For example these 3 pages:

  • Page1
  • Page2
  • Page3

In Page1, the menu should be:
Page2, Page3, Page1

Page 2:
Page3, Page1, Page2

Page1, Page2, Page 3

I’m guessing reorder the menu array. How do I do array splice and push in Go?

i have this in my navigation.html

{{ if .IsPage }}
	<div class=pt4>
		{{if .NextInSection}}<a href={{.NextInSection.Permalink}} title="{{.NextInSection.Title}}">next</a>{{else}}no next{{end}} 
		{{if .PrevInSection}}<a href={{.PrevInSection.Permalink}} title="{{.PrevInSection.Title}}">prev </a>{{else}}no prev{{end}}

little simplified for understanding

1 Like