Iterate through a page headings

There’s no easy way to do it, but you might have a look at this:
https://discourse.gohugo.io/t/splitting-content-into-sections-based-on-header-level/33749/6