fix(seo): correct sitemap routes

This commit is contained in:
syntaxbullet
2026-07-31 19:03:07 +02:00
parent 0a19abd0b0
commit 07e9458aaf
13 changed files with 515 additions and 61 deletions

View File

@@ -20,3 +20,18 @@ const previewPublicationQuery = Object.freeze({
export function getPublicationQueryOptions(isPreview: boolean): PublicationQueryOptions {
return isPreview ? previewPublicationQuery : publicPublicationQuery
}
/**
* Adds an explicit status predicate for public indexes such as sitemaps while
* retaining the same anonymous access and draft behavior as public routes.
*/
export function getPublicPublishedQueryOptions() {
return {
...getPublicationQueryOptions(false),
where: {
_status: {
equals: 'published' as const,
},
},
}
}