DEV Community

Discussion on: Create a Dynamic Sitemap with Next.js

Collapse
 
christiankozalla profile image
Christian Kozalla

I am using a similar generate-sitemap script manually, thinking how to automate it on every new blog post (dynamic route). But I need to add the new sitemap.xml to the commit in order to push it to origin master, from where it is atomically deployed to vercel.
Is that possible with your first solution at build time?
Thank you very much for your article, I really enjoyed it 👍

Collapse
 
codebycorey profile image
Corey O'Donnell

I deploy my website using Vercel. Anytime my main branch changes, it triggers a build and runs my generate-sitemap through next.config.js. Since Vercel is running my script, I do not need to commit it to repository.

Collapse
 
christiankozalla profile image
Christian Kozalla

Alright, so that would work out for me. Thank you!