Sitemap generation does not follow file location specification
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 142k
- Forks
- 32.5k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 351
Description
Link to the code that reproduces this issue
https://github.com/dretsa/next-sitemap-spec
To Reproduce
- Generate multiple sitemaps as per documentation
- Check paths generated and see they do not follow the specification
Example - /app/product/sitemap.ts generates - from docs example:
/product/sitemap/0.xml/product/sitemap/1.xml/product/sitemap/2.xml/product/sitemap/3.xml
According to the specification, these sitemaps can only contain links starting with /product/sitemap/....., as specified in the "Sitemap file location" section.
Current vs. Expected behavior
I expect the generated sitemaps in a route app/product/sitemap.ts to allow me link /product/... pages. Currently they can only provide URLs starting with /product/sitemap/...
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:22 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6041
Available memory (MB): 49152
Available CPU cores: 14
Binaries:
Node: 22.2.0
npm: 10.7.0
Yarn: 4.6.0
pnpm: N/A
Relevant Packages:
next: 15.1.7
eslint-config-next: 15.1.7
react: 19.0.0
react-dom: 19.0.0
typescript: 5.7.3
Next.js Config:
output: standalone
Which area(s) are affected? (Select all that apply)
Metadata, Route Handlers
Which stage(s) are affected? (Select all that apply)
next build (local), next start (local), next dev (local), Vercel (Deployed), Other (Deployed)
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked next-sitemap-spec reproduction and the app/product/sitemap.ts example, then compare the generated paths with the Sitemap file location specification in the linked Next.js documentation. Trace the metadata sitemap generation behavior involved in multiple sitemaps. Done means generated URLs can reference /product/... pages while remaining valid under the specification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nextjs, typescript
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100