Building with the Next.js App Router
Notes on static generation, layouts, and keeping pages fast.
March 15, 20265 min readMSG Encrypted
next.js
react
performance
The App Router in Next.js encourages colocation of routes, loading states, and metadata. For content-heavy sites, pairing file-based markdown with generateStaticParams keeps builds predictable.
Tips
- Parse markdown at build time on the server.
- Use
generateMetadatafor SEO on dynamic routes. - Keep shared layout chrome in
layout.tsxand let each route stay thin.
export async function generateStaticParams() {
return getPostSlugs().map((slug) => ({ slug }))
}
This pattern maps cleanly to a folder of .md files in content/blog/.