shuding / nextra

Simple, powerful and flexible site generation framework with everything you love from Next.js.
https://nextra.site
MIT License
11.32k stars 1.24k forks source link

Using CompileMdx to rerender site pages #3122

Open ardenc opened 1 month ago

ardenc commented 1 month ago

Hi, question on this package I am trying to make every single page on my Nextra site completely dynamic.

It for internal documentation any every user can live edit a doc on the page and have it replace the version currently there.

I have all this working fine.

When in production mode obviously changes to the file wont re-render the newest versions of the mdx file.

So I have semi implemented a way to always dynamically pull mdx for the page using an api route and compileMdx and I have this almost all working. Only real issue I have is that Compile Mdx does not appear to add the styles as normal to the mdx components.

Is there a way to get these to apply so it looks like a normal page on the docs theme with all the normal applied styles? Or a different way to dynamically rerender my mdx content and apply all the styles?

Basically what I am looking for is how it works in next dev mode but with a working search. ^ Note I am fine with the searches only being updated once a day. I will have a script that just rebuilds the site every day in the evening.

CryptoTyson commented 6 days ago

Can you share a code sandbox of your implementation, please?