gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
75.2k stars 7.48k forks source link

MDX Markdown Support #12902

Open drush opened 1 week ago

drush commented 1 week ago

MDX has matured quite a bit since this was discussed previously on the forum.

It is also supported by many of the newer SSGs such as Astro, Next etc. Supporting MDX is now table stakes for Hugo to stay a competitive option.

This also makes it very easy to build pages with interactive components (charts, forms, etc).

bep commented 1 week ago

It would be good if you could add some lines about how you would propose to implement this.

Supporting MDX is now table stakes for Hugo to stay a competitive option.

I didn't know this was a ... competition? Never mind ...

I have looked at MDX, and to me it looks like a odd construct, and probably a bad fit in Hugo, especially considering that there's no native Go implementation of this (is it?). In my head, Markdown shines for (potentially lots of) content rendered to e.g. HTML. Having Markdown transpiled to JavaScript which then gets rendered to HTML in the browser sounds a little bit off to me, and I think it would be good for Hugo to be a little original in this department. To stay competitive, so to speak :-)

The next Hugo will come with improved support for JS code splitting/bundling/etc., which should make it trivial to add React/JSX/TSX via shortcodes/render hooks, which in my head is a nicer separation of concerns compared to MDX.

But maybe I missed something. The proposal was very brief.