Skip to content

How I can use anchor from Fumadocs with my Contentlayer configuration? #514

Answered by fuma-nama
johanguse asked this question in Q&A
Discussion options

You must be logged in to vote

Oops your toc compute field overrode the original toc field which contains the table of contents parsed by Fumadocs.

We no longer provide the remark headings plugin on Contentlayer because they don't support exporting other properties from MDX file.
Remark headings is the plugin that parses table of contents and processes anchors, it needs a way to export its output so that you can access table of contents from your code. Now Contentlayer doesn't support a way to access the output yielded by a remark plugin. We used the suboptimal way, which parse the table of contents again by running remark again.

You can still opt-in by passing the remark headings plugin, but I will recommend using Fum…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@johanguse
Comment options

Answer selected by johanguse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants