Any way I can access the page index number?

My website has multiple pages. I want to find the index of a specific page in site.RegularPages sorted by date. One way I can do is through linear search over the regular pages slice.

The use case is an enumeration, where I want to have the Page index as a title. For example, “Report #1: Analysis of bla bla”.

I was just wondering if Hugo’s bookkeeping mechanism already has something for this. Maybe something like $page.Index?

I posted a sample days ago


1 Like