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
Use next.js 14's sitemap export function to create a Google News compatible sitemap, by adding some extra supported fields to the return
Allow for extensibility to sitemap export based on stable existing schemas
Non-Goals
Create arbitrary non-defined exports within sitemap export.
Background
Google documents a specific stable set of News-based extensions to the Sitemap schema (under news:news container) which they use for better indexing news media for their news section.
While I could use another tool like next-sitemap to generate this, it would be useful for a unified approach if there was a way to optionally include these fields (or perhaps other extensions, google and non, in a more extensible approach) using the great new sitemap() export feature in the app dir.
Proposal
To me it seems it would be clean enough to add an extra news: {...} object within each entry object that would work identically to how openGraph schema extensions are implemented in the generateMetadata() export. Other Google extensions (image, news) could work similarly.
Happy to contribute if needed, though haven't yet on this codebase!
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.
-
Goals
Non-Goals
Background
Google documents a specific stable set of News-based extensions to the Sitemap schema (under news:news container) which they use for better indexing news media for their news section.
While I could use another tool like next-sitemap to generate this, it would be useful for a unified approach if there was a way to optionally include these fields (or perhaps other extensions, google and non, in a more extensible approach) using the great new sitemap() export feature in the app dir.
Proposal
To me it seems it would be clean enough to add an extra news: {...} object within each entry object that would work identically to how openGraph schema extensions are implemented in the generateMetadata() export. Other Google extensions (image, news) could work similarly.
Happy to contribute if needed, though haven't yet on this codebase!
Beta Was this translation helpful? Give feedback.
All reactions