7

md vs mdx

md import pipeline renders to html, mdx import pipeline renders to .js/.ts/.jsx... which allows to customize html tags with Astro components.

goal

I would like to take advantage of the mdx power in .md files with Astro

what I tried

  • tried to configure mdx integration in Astro but it is excluding .md extension unfortunately to allow default md rehype pipeline

  • My workaround of renaming all .md files to .mdx is very intrusive (changes files meta data) I would like to find a different approach

  • forking mdx integration is hard to maintain

  • I started a vite plugin that changes .md ids to add an x as .mdx, then I had to write my own loader, then it got too complex

  • astro-remote only takes some default components and does allow to replace any custom component

examples

I would like to avoid

and rather

Any ideas of the finest approach to achieve this, it feels like this last step is missing to unleash Astro's power over Markdow !!!

references

wassfila
  • 1,173
  • 8
  • 18

0 Answers0