createVexSitemap
createVexSitemap<
Query>(props): () =>Promise<SitemapFile>
Defined in: packages/next/src/seo/createVexSitemap.ts:18
Creates a Next.js sitemap.ts default export from a Convex published-slugs
query (packages/core/src/api/publishedSlugs/server.ts).
Tolerates an unreachable Convex deployment (P-020): a read failure returns
[] — an empty sitemap — rather than failing the build.
Type Parameters
Section titled “Type Parameters”Query extends FunctionReference<"query">
Parameters
Section titled “Parameters”Sitemap configuration.
OptionalRestArgs<Query>[0]
client
Section titled “client”getSlug
Section titled “getSlug”(item) => string
getUpdatedAt?
Section titled “getUpdatedAt?”(item) => number | undefined
Optional last-modified extractor. Omit it when the collection carries no
modification timestamp — Convex’s _creationTime is set at insert and
never moves, so reporting it as lastModified would be a lie.
lastModified is optional in the sitemap protocol; an absent value is
correct, a wrong one costs crawl budget.
May return undefined for an individual item, and that is the common
case: defineCollection injects updatedAt on every content collection,
but only a write through create/update populates it — a seeded or
imported row has none. Those entries are emitted with no lastModified
rather than an Invalid Date.
Query
(slug) => string
Maps one item’s slug to its absolute public URL — the route mapper, so URL
shape (e.g. /blog/[slug] vs /[slug]) is the caller’s choice.
Returns
Section titled “Returns”A sitemap() function suitable as app/sitemap.ts’s default export.
() => Promise<SitemapFile>