Global configuration for custom MDX components #3063
Closed
ohansemmanuel
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Hey @ohansemmanuel 👋, we don't have plans for global MDX components for now, according to our public roadmap. The community package astro-auto-import is compatible with MDX and works similarly to what you proposed, I hope it can help you! EDIT: Also, our recent Markdoc integration, which is a different file format/syntax, so I would not recommend migrating to it only for that, can do that: https://docs.astro.build/en/guides/integrations-guide/markdoc/#render-markdoc-tags-as-astro-components |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey there 👋🏽
Out of curiosity, Is there an ongoing consideration to make it possible to configure custom MDX components for an Astro project in one place? Without repetition across multiple pages/files?
As it stands, it appears custom components have to be defined per page where they are consumed.
While one may arguably build a remark plugin / Astro integration to auto-import components, it might be nice to support configuring these in one place, if it doesn't already exist. Similar to how NextJS uses an MDXProvider in the app.js file.
Potentially, these may work:
markdown
configuration option inastro.config.mjs
...
Cheers
Beta Was this translation helpful? Give feedback.
All reactions