#Remote .md and .mdx with astro components

7 messages · Page 1 of 1 (latest)

spring crypt
#

I'm currently using a remote headless CMS (strapi) with NextJS to provide my markdown content and render it to React components.

The markdown files contain some html elements that are later transformed to some interactive React components. The format is similar to this:

<div id="calculator" />

Which then is transformed to a fully interactive JSX React component.

The problem is that to achieve this the hole article / page needs to be client-side and contributes to a worse performance.

I would like to render each component server-side or client-side individually as it needs, just like astro works.

Is there any way to compile the remote .md or .mdx to the astro format, converting those html elements to astro components?

Thanks beforehand!

calm bobcat
icy snow
#

Astro-remote is also good, esp for some fancier stuff

#

Oh I see you need javascript to render some components, unsure if there is a good approach, especially with SSR but also SSG

spring crypt
#

@icy snow @calm bobcat Thanks! I will give astro-remote a try

silk prairie