#Multiple Sitemaps

1 messages · Page 1 of 1 (latest)

forest oxideBOT
#

Hi @blazing bloom. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

I'm sorry, but based on the information provided in the extracts, Next.js currently does not support generating multiple sitemaps. However, it is mentioned that this feature will be supported in the future.

For now, you can generate a single sitemap by adding a sitemap.js or sitemap.ts file that returns a Sitemap type. Here's an example:

import { MetadataRoute } from 'next'
 
export default function sitemap(): MetadataRoute.Sitemap {
 return [
 {
 url: '<https://acme.com',>
 lastModified: new Date(),
 },
 {
 url: '<https://acme.com/about',>
 lastModified: new Date(),
 },
 {
 url: '<https://acme.com/blog',>
 lastModified: new Date(),
 },
 ]
}

This will generate a sitemap.xml file with the specified URLs.

For more details, please refer to the Next.js documentation on sitemaps (https://nextjs.org/docs/app/api-reference/file-conventions/metadata/sitemap).

Please keep an eye on the official Next.js updates for the support of multiple sitemaps in the future.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: