Help - How to Parse my TOC.md content and then use them in layout template?

Our documentation have a toc(table of contents) markdown file(shown at below), how can i parse it and then use them in layout template to render navigation part html.
i have tried use readFile function, but it’s hard to parse the level of titles in template syntax(which is limited golang syntax supported).
anyone have a good idea to handle this?

# xxx Documentation

## Documentation List

+ [About xxx](overview.md)
  - [xxx Introduction](overview.md#xxx-introduction)
  - [xxx Architecture](overview.md#xxx-architecture)
+ [xxx Quick Start Guide](./QUICKSTART.md)
  - [About xxx](./QUICKSTART.md#about-xxx)
  - [About This Guide](./QUICKSTART.md#about-this-guide)
  - [Deploy a xxx Cluster](./QUICKSTART.md#deploy-a-xxx-cluster)
  - [Try xxx](./QUICKSTART.md#try-xxx)
  - [Monitor the xxx Cluster](./QUICKSTART.md#monitoring-a-xxx-cluster)
  - [Scale the xxx Cluster](./QUICKSTART.md#scale-the-xxx-cluster)

I’m a bit fuzzy on if you’re trying to create an in-page nav/today or if you’re including secondary navigation at the detail/article/post level?

Hugo comes with built in TOC support too. Not sure if you’ve already checked this out in the documentation:

1 Like