Functions
Partition a sitemap inventory
Split a large public URL inventory into bounded chunks. Next.js 16 passes the generated sitemap ID asynchronously as a string. Never list private or untranslated pages; the sitemap is not an access-control mechanism. Example context: isolated Next.js 16.x candidate; snippet is partial unless it defines a complete convention file. Lifecycle: documented. Expected behavior / verification: Expected two disjoint public URL sets. Verify actual generated sitemap routes, XML and status in production. Source: https://nextjs.org/docs/app/api-reference/functions/generate-sitemaps Exact installed signature, typecheck and framework execution not run.
Formal Syntax & Structure
nextjs syntaxnextjs
generateSitemaps(); sitemap({id})Working Example
Example Snippetnextjs
import type { MetadataRoute } from 'next'; export function generateSitemaps(){return [{id:0},{id:1}]} export default async function sitemap({id}:{id:Promise<string>}):Promise<MetadataRoute.Sitemap>{const group=await id; return [{url:`https://example.com/catalog/${group==='0'?'moss':'fern'}`}]}