@@ -59,6 +59,12 @@ export type SiteURLData = Pick<
5959 * By knowing it's a fallback, we can redirect to the space base path instead of returning a 404.
6060 */
6161 isFallback ?: boolean ;
62+
63+ /**
64+ * Whether search indexation is blocked for this deployment.
65+ * Computed in middleware from GITBOOK_BLOCK_SEARCH_INDEXATION env var and x-gitbook-search-indexation header.
66+ */
67+ noIndexSearch ?: boolean ;
6268} ;
6369
6470/**
@@ -150,6 +156,9 @@ export type GitBookSiteContext = GitBookSpaceContext & {
150156
151157 /** Whether this request is a fallback rendering. */
152158 isFallback : boolean ;
159+
160+ /** Whether search indexation is blocked for this deployment. */
161+ noIndexSearch : boolean ;
153162} ;
154163
155164/**
@@ -229,6 +238,7 @@ export async function fetchSiteContextByURLLookup(
229238 revision : data . revision ,
230239 contextId : data . contextId ,
231240 isFallback : data . isFallback ?? false ,
241+ noIndexSearch : data . noIndexSearch ?? false ,
232242 } ) ;
233243}
234244
@@ -248,6 +258,7 @@ export async function fetchSiteContextByIds(
248258 revision : string | undefined ;
249259 contextId ?: string ;
250260 isFallback : boolean ;
261+ noIndexSearch : boolean ;
251262 }
252263) : Promise < GitBookSiteContext > {
253264 const { dataFetcher } = baseContext ;
@@ -371,6 +382,7 @@ export async function fetchSiteContextByIds(
371382 scripts,
372383 contextId : ids . contextId ,
373384 isFallback : ids . isFallback ,
385+ noIndexSearch : ids . noIndexSearch ,
374386 } ;
375387}
376388
0 commit comments