I'm building a site that makes use of Nextjs and Contentlayer to render a bunch of MDX files.
I basically followed this tutorial to get it set up, except I'm going with MDX instead of plain markdown.
I'm using Contentlayer because the standard way of supporting MDX in Next just doesn't fit my use-case very well.
The Next.js MDX docs have a section on Custom elements. It lets you, for example, decide that all your h1
s will be rendered with your custom component or whatever.
My question is: Is there a way to set up custom elements when using Contentlayer?
I assume there is some way to configure rehype or remark, I'm new to both of these tools.