Skip to content

How to render or load a list of markdown files dynamically in a page? Remix Vite #2542

Closed Answered by zxlvera
zxlvera asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Christian,

Thanks for replying. Yes I was referring to the route /changelog where I will display 'release notes' on a website.

I figured out after referring to NextJS documentation for MDX here. Remix's documentation on MDX wasn't helpful. Hope my solution will help others.

What I did was to include an export component in every *.mdx file in a content folder.

import { MdxLayout } from "../../components/mdx-layout.tsx";

# Header 1

body text

export default ({ children }) => <MdxLayout>{children}</MdxLayout>;

and created a MdxLayout component shown in NextJS documentation here

export default function MdxLayout({ children }: { children: React.ReactNode }) {
  // Create any shared layou…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by zxlvera
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants