Load MDX Files and display them
Unanswered
Μοχάμεντ posted this in #help-forum
ΜοχάμεντOP
I want to load mdx files from ./docs and display them but instead of adding the paths to [slug].tsx in app/docs/[slug].tsx. I want it to automatically update and display the md.
I have 2 docs folders one in root and one is app directory. The one in app directory should read the files from root etc etc. I am using next-remote-mdx.
(i am a beginner so explain in cave man terms please. I just want to create a site for my discord bot)
I have 2 docs folders one in root and one is app directory. The one in app directory should read the files from root etc etc. I am using next-remote-mdx.
(i am a beginner so explain in cave man terms please. I just want to create a site for my discord bot)
15 Replies
Rose-breasted Grosbeak
Did you check the docs?
https://nextjs.org/docs/app/building-your-application/configuring/mdx
https://nextjs.org/docs/app/building-your-application/configuring/mdx
ΜοχάμεντOP
Mb
I didn’t know there were docs for this
Rose-breasted Grosbeak
RTFM moment
ΜοχάμεντOP
RTFM?
Peterbald
RTFM → read the f--king manual
ΜοχάμεντOP
Oh
Mb
ΜοχάμεντOP
in docs they say u can style using
mdx-components.tsx but can u do it using css fileRose-breasted Grosbeak
Which part are you referring to?
@Rose-breasted Grosbeak Which part are you referring to?
ΜοχάμεντOP
styling my .mdx files
also anyway to make it so that u dont have to add all valid slug urls in
export function generateStaticParams() {
const slugs = ['test', 'welcome', 'about']; // Ensure all valid slugs are listed
return slugs.map(slug => ({ slug }));
}cuz am making a documentation page
and i have around 150 files
ΜοχάμεντOP
nvm figured it out