
🗺️ next-dynamic-sitemap
I built next-dynamic-sitemap
because I was tired of manually maintaining sitemap.xml
files in Next.js projects — especially once dynamic routes get involved. Static routes are easy, but once you start using generateStaticParams
or getStaticPaths
, it becomes frustratingly manual to keep everything in sync.
This tool automates that. It crawls your App Router and Pages Router trees at build time and generates a complete sitemap.xml
, including dynamic routes with custom lastModified
timestamps pulled straight from your static param functions. That means your sitemap stays accurate — and search engines stay happy — with zero extra effort.
✅ App Router support (generateStaticParams
)
✅ Pages Router support (getStaticPaths
)
✅ Auto-skips non-static routes
✅ Pulls lastModified
metadata directly from your code
✅ Plays nicely with .env
— no weird config files or magic strings
Just run it before your Next.js build, and you’re done.
Looking for runtime sitemap support instead?
Check out next-runtime-sitemap
— a complementary tool that generates sitemap.xml
dynamically at request time, perfect for serverful deployments or hybrid solutions.
I use these tools in most of my Next.js projects now. They’re simple, smart, and don’t try to do too much — which is exactly how I like my tooling.