You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current generic sitemap has many restrictions and doesn't allow developers to generate custom sitemaps using generate function. Developers should be free to add any tags to sitemaps. Otherwise, developers will require to implement custom code to generate the sitemap in advence before they publish the website.
Here is the old structure for adding generic sitemap.
/** * Update this with the domain of your site */constConfig={domain: 'https://www.test.com'}exportinterfacePage{slug: string,}exportconstcreateSitemapUrlSet=(pages: Page[]): string=>{consturlSet=pages.map((page)=>(`<url> <loc>${Config.domain}${page.slug}</loc> </url>`)).join('');return(`<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">${urlSet} </urlset>`);};
the code above is an example how to generate the generic sitemap but it's not consistent at all when it comes to compare with the recent development structure.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Her are some examples
Video example
Image Example
Non-Goals
No response
Background
Current generic sitemap has many restrictions and doesn't allow developers to generate custom sitemaps using generate function. Developers should be free to add any tags to sitemaps. Otherwise, developers will require to implement custom code to generate the sitemap in advence before they publish the website.
Here is the old structure for adding generic sitemap.
the code above is an example how to generate the generic sitemap but it's not consistent at all when it comes to compare with the recent development structure.
Proposal
The resolver function for sitemap (resolveSitemap in packages/next/src/build/webpack/loaders/metadata/resolve-route-data.ts) should extended according to desired tags or the function should be more generic to use for adding custom tags.
I would like to investigate to this part if no one doesn't have availability.
Related Tickets: #63411, #61971, #61555
Beta Was this translation helpful? Give feedback.
All reactions