Help - How to Parse my 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](
  - [xxx Introduction](
  - [xxx Architecture](
+ [xxx Quick Start Guide](./
  - [About xxx](./
  - [About This Guide](./
  - [Deploy a xxx Cluster](./
  - [Try xxx](./
  - [Monitor the xxx Cluster](./
  - [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