How to render TOC in aside snippet

I’m using the TOC plugin and I would want the resulting list in an aside tag so not above the actual page-content

like the links on the left in this codepen, which I’m working on

As far as I can tell from the plugin code, you should be able to output the toc tag separately from the headings:

  <?php echo kirbytext('(toc: 2)', $page) ?>

Wow thanks, This works like a charm, I had no idea that this could be so easy!