My first approach would be to try to use computed fields for this. ## Related - https://github.com/syntax-tree/mdast-util-toc - https://github.com/remarkjs/remark-toc - https://github.dev/shuding/nextra/blob/f8d25f29d321550b6586f9d6ed0546e8654dd1f8/packages/nextra/src/types.ts#L25
My first approach would be to try to use computed fields for this.
Related