sitemapXml Reference
The sitemapXml function generates a sitemap.xml file for your Next.js application.
Parameters
Section titled “Parameters”The sitemapXml function accepts one optional parameter: an array of route configuration objects.
sitemapConfig
Section titled “sitemapConfig”type: SitemapConfig[]
An array of route configuration objects. Each object can contain the following properties:
route (required)
Section titled “route (required)”type: string
The route path for the page (e.g., /about, /blog/post-1).
lastModified
Section titled “lastModified”type: string | Date
The date when the page was last modified.
changeFrequency
Section titled “changeFrequency”type: 'always' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'never'
How frequently the page is likely to change.
priority
Section titled “priority”type: number
The priority of this URL relative to other URLs on your site. Value must be between 0.0 and 1.0.
alternates
Section titled “alternates”type: { languages?: Languages<string> }
Language alternates for the page.