You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently in the process of building a documentation template similar to what Nextra provides for Next.js.
At that, I'm currently stuck on indexing my site's content.
I've successfully built an MDX parser that recompiles on change. MDXBundler has been very helpful to that end. Here's the general flow:
Build MDX pages with frontmatter for required data (things like title, search properties, etc...).
Parse MDX into JSX using MDXBundler.
Render JSX content to string using react-dom/server.
Strip HTML.
Build site index using a mix of MDX frontmatter and the stripped HTML content.
This works fine for simple MDX pages, but fails whenever I encounter content that relies on clientside specific code (like a useLocation hook, or Remix's <Link /> component).
Has anyone else done something like this before? I'm wondering what my options are.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently in the process of building a documentation template similar to what Nextra provides for Next.js.
At that, I'm currently stuck on indexing my site's content.
I've successfully built an MDX parser that recompiles on change. MDXBundler has been very helpful to that end. Here's the general flow:
react-dom/server
.This works fine for simple MDX pages, but fails whenever I encounter content that relies on clientside specific code (like a
useLocation
hook, or Remix's<Link />
component).Has anyone else done something like this before? I'm wondering what my options are.
Beta Was this translation helpful? Give feedback.
All reactions