@sanity/routes
    Preparing search index...

    Interface RoutesPresentationOptions

    Options for customizing the auto-generated Presentation tool config.

    interface RoutesPresentationOptions {
        extraLocations?: Record<
            string,
            (
                doc: { href: string; title?: string },
            ) => { href: string; title: string }[],
        >;
        mainDocuments?: unknown[];
    }
    Index

    Properties

    extraLocations?: Record<
        string,
        (
            doc: { href: string; title?: string },
        ) => { href: string; title: string }[],
    >

    Add extra locations beyond the canonical URL for specific document types.

    routesPresentation('web', {
    extraLocations: {
    product: (doc) => [
    { title: 'All Products', href: '/products' },
    ],
    },
    })
    mainDocuments?: unknown[]

    Static mainDocuments entries for URL → document resolution.

    Since mainDocuments must be an array at config time (not reactive), pass them explicitly if you need the Presentation tool to resolve URLs back to documents.

    These are passed through directly to the Presentation tool's resolve.mainDocuments option.

    routesPresentation('web', {
    mainDocuments: [
    { route: '/blog/:slug', filter: '_type == "blogPost" && slug.current == $slug' },
    { route: '/docs/:slug', filter: '_type == "article" && slug.current == $slug' },
    ],
    })