The route config channel (e.g., 'web')
Optionaloptions: RoutesPresentationOptionsOptional overrides for extra locations and mainDocuments
Object with locations (and optionally mainDocuments) for the
Presentation tool's resolve config
import { routesPresentation } from '@sanity/routes/plugin'
presentationTool({
resolve: routesPresentation('web'),
})
presentationTool({
resolve: routesPresentation('web', {
mainDocuments: [
{ route: '/blog/:slug', filter: '_type == "blogPost" && slug.current == $slug' },
{ route: '/docs/:slug', filter: '_type == "article" && slug.current == $slug' },
],
extraLocations: {
blogPost: (doc) => [
{ title: 'Blog index', href: '/blog' },
],
},
}),
})
Auto-generate Presentation tool
resolveconfig from route configuration.Reads route config + route map shards from the Content Lake to generate document locations reactively. When a document's route or the route config changes, the location updates automatically via
listenQuery.locations(document → URL): Uses aDocumentLocationResolverfunction that queries the route map shard for the document's type. The route map contains pre-computed paths, so no client-side GROQ evaluation is needed.mainDocuments(URL → document): Optionally accepts static entries viaoptions.mainDocuments. These can't be generated dynamically because the Presentation tool needs them at config time.