Table Of Contents
For pages with a lot of content it can be helpful to provide links to each section of the page using a table of contents.
To generate table of contents enable the transform in your site settings:
[]
= true
Which will make the compiler generate anchors for every heading and enable support for the toc helper.
Now for pages that need a table of contents you just call the toc helper like this:
Using the details element as a wrapper for the table of contents allows the visitor to collapse the menu; see this example partial for markup and a working example is here.
Be careful where you put headings otherwise you may get too many entries in your table of contents. For example, if you are using a sidebar navigation with sections it is tempting to use headings to delimit the sections but these would also appear in the table of contents which is probably not what you want!