#Multiple Sitemaps
1 messages · Page 1 of 1 (latest)
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).