A Next.js markdown blog static site built with the App Router and MDX
Note: To see a Live Demo, check out the Next.js Markdown Blog (Pages Router) version and open the Live Demo link
- clone the repo and
cd
into it, then run:
npm install
- run the development server:
npm run dev
-
create a new folder inside
app/(blog)/
with the name of your post -
create a new
page.mdx
file inside the folder -
add the Markdown content of your post in the
page.mdx
file
TIP: MDX supports JSX, so you can also import and use React components in your MDX files
- Make sure to add
output: 'export',
to thenext.config.mjs
file
const nextConfig = {
output: 'export',
}
- run the build command:
npm run build
- run the static site:
npx serve@latest out