Generate outline from all Headings of a page

Hello everybody,

i was wondering if there is a way in the template to generate an outline of the current page. What I mean by that, is a list of all the headings on the page. That list might be nested to show the relationships of headings and subheadings.
What I would like to achieve is for longer pages with lots of headings and subheadings, is to have a sidebar on these pages which will let you quickly jump around on the page.

Does something like this exist in kirby and if not, is there a way to get all the headings on a page? I have checked the reference of $page and did not find anything that points in that direction.

Thanks!

A starting point: Of anchors and ToCs, part 1 | Kirby CMS

1 Like

Thank you very much, that is exactly what I was looking for! I guess I was looking for the wrong keywords. :sweat_smile: