The easy way to make a website with Markdown

https://news.ycombinator.com/rss Hits: 4
Summary

Next.js 15 Markdown Boilerplate A minimal Next.js 15 application that renders content from Markdown files. Features Render Markdown files as dynamic pages Add React components anywhere in your Markdown The folder structure becomes the URL path Global styles using Tailwind CSS and DaisyUI See a live example at nextjs-markdown-boilerplate.vercel.app/ How to use it I'm lazy, so I made this extremely simple. Pages Just write some markdown in a .mdx file, and it will automatically become a properly styled page. # My Page This is my page. Routing Add new pages by creating .mdx files in the app/content directory. The file name becomes the URL path: app/content/index.mdx → / → app/content/a-beautiful-page.mdx → /a-beautiful-page → app/content/more-content/another-page.mdx → /more-content/another-page React Components Add custom React components to the components directory. Then, import them at the top of an MDX file and use them like any other React component. import MyComponent from ' ../components/my-component ' ** Hey ** , here's a component: < MyComponent /> * And here's some more markdown content. * Next.js 15 Async API Caveats In Next.js 15, dynamic APIs like params and searchParams are now asynchronous. The boilerplate handles this automatically in the page component, but if you add custom logic: // In a page or layout export default async function Page ( { params , searchParams } ) { const { slug } = await params // Await params const { query } = await searchParams // Await searchParams // Your code } For static behavior, avoid using cookies() , headers() , draftMode() in layouts or pages unless necessary. Static vs Dynamic Behavior This boilerplate is static-first: pages are pre-rendered at build time. If you need dynamic features (e.g., user-specific content), opt into dynamic rendering by using the async APIs above or adding export const dynamic = 'force-dynamic' to a page. Optional Recipes SEO/Sitemap : Add next-sitemap for automatic sitemap generation. : Add fo...

First seen: 2025-09-02 16:52

Last seen: 2025-09-02 19:52