Per this page https://gohugo.io/content-management/formats/ it doesn’t seem like MDX is supported by Hugo, but I wanted to confirm that was the case.
MDX is Markdown for JSX. Since Hugo doesn’t use JSX itself, there’s no support for MDX.
However, if you’re looking to be able to use components in your Markdown files, you’re probably looking for shortcodes: https://gohugo.io/content-management/shortcodes/
I’m familiar with shortcodes, but I’m wondering if there’s a way to interpret MDX files without modifying them, and it seems like that isn’t possible through Hugo.
I’m not very familiar with MDX, but I have some ideas that should be possible to add to Hugo once the
js.Build integration matures (that is soonish in the pipeline, waiting for ESBuild 0.8 to get plugin support) …
I’m not sure it would take the form of “reading MDX files” (MDX is a new format coming from a platform without the concept of a shortcode), but is should be possible to include JSX (maybe we can create a
mdx internal shortcode).
the esbuild integration is quite nice now but I don’t know anything about gohugo internals to assess if it’s mature enough for such a feature. Very personal obviously but MDX is the only thing I miss from other static sties generators