how to use rehype-meta with next.js's mdx integration #1921
-
I have a next.js site that uses next.js's mdx v2 integration (for instance, I can place a I have found the rehype-meta plugin that promises to do that. ...
rehypePlugins: [
[rehypeMeta, {
og: true
}],
... ], ... The result is that the
which perhaps unsurprisingly results in a How do I get the Ultimately, I would love to use the inferring plugins as well to automatically produce page titles (and og metadata) from headings in the mdx content. Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
It looks like next uses a specialized component to add metadata to the head of the page https://nextjs.org/learn/seo/crawling-and-indexing/metatags |
Beta Was this translation helpful? Give feedback.
-
Ok, so this works now partially. By mapping
in the header. How do I use (Naive question: what's a title in an mdx document? Something after |
Beta Was this translation helpful? Give feedback.
It looks like next uses a specialized component to add metadata to the head of the page https://nextjs.org/learn/seo/crawling-and-indexing/metatags
It may take some component mapping to have the contents of the
<head>
tag mdx generates, to instead pass it to Next's<Head>
component instead.