How to create sitemaps at buildtime instead of runtime. #571
-
As mentioned here, #544 (comment), the postbuild command is not required for serverside sitemap generation, which means the dynamic data will be generated at Runtime when crawlers visit the sitemap page. So is there a way to generate sitemap at build time, so API call is made when building and whole xml file with all urls in generated at build time? Q2) Is it possible to define in build script if I only want to generate one specific sitemap like my-custom-sitemap-2.xml and not all the sitemaps? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
https://github.com/iamvishnusankar/next-sitemap#additional-paths-function
Yes, you can set the sitemapBaseFileName and disable generation of index sitemap. |
Beta Was this translation helpful? Give feedback.
So is there a way to generate sitemap at build time, so API call is made when building and whole xml file with all urls in generated at build time?
https://github.com/iamvishnusankar/next-sitemap#additional-paths-function
Q2) Is it possible to define in build script if I only want to generate one specific sitemap like my-custom-sitemap-2.xml and not all the sitemaps?
Yes, you can set the sitemapBaseFileName and disable generation of index sitemap.