Generating dynamic/server-side sitemaps
APIs to generate dynamic/server-side sitemaps.
Generating dynamic/server-side sitemaps
next-sitemap
now provides two APIs to generate server side sitemaps. This will help to dynamically generate index-sitemap
(s) and sitemap
(s) by sourcing data from CMS or custom source.
getServerSideSitemapIndex
getServerSideSitemapIndex: Generates index sitemaps based on urls provided and returns application/xml
response. Supports next13+ route.[ts,js] file.
- To continue using inside pages directory, import
getServerSideSitemapIndexLegacy
instead.
getServerSideSitemap
getServerSideSitemap: Generates sitemap based on field entires and returns application/xml
response. Supports next13+ route.[ts,js] file.
- To continue using inside pages directory, import
getServerSideSitemapLegacy
instead.