mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
### What Fix bad detection of dynamic route of sitemap metadata route, the swc AST check should process when the text are detected. But prevuious if there's text with `generateSitemap` such as comment but not the actual export it will fail. ### How Add both checks on metadata loader side and detection helper side * Only call `generateSitemaps` helper when the export existed * Fix the helper detection logic (major part of this PR) Fixes #59698 Closes #60344 Closes NEXT-2007
19 lines
388 B
TypeScript
19 lines
388 B
TypeScript
import 'server-only'
|
|
import { MetadataRoute } from 'next'
|
|
|
|
/* without generateSitemaps */
|
|
export default function sitemap(): MetadataRoute.Sitemap {
|
|
return [
|
|
{
|
|
url: 'https://example.com',
|
|
lastModified: '2021-01-01',
|
|
changeFrequency: 'weekly',
|
|
priority: 0.5,
|
|
},
|
|
{
|
|
url: 'https://example.com/about',
|
|
lastModified: '2021-01-01',
|
|
},
|
|
]
|
|
}
|