[Docs Site] Add noindex to 404 pages (#23665)

This commit is contained in:
Kian 2025-07-15 13:59:18 +01:00 committed by GitHub
parent 4f708ee9a1
commit 2c4a8818ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 1 deletions

View file

@ -10,6 +10,7 @@ const props = {
template: "splash",
editUrl: false,
feedback: false,
noindex: true,
},
hideTitle: true,
hideBreadcrumbs: true,

View file

@ -27,6 +27,7 @@ const props = {
tableOfContents: false,
editUrl: false,
feedback: false,
noindex: true,
},
hideTitle: true,
hideBreadcrumbs: true,

View file

@ -105,7 +105,14 @@ export default class extends WorkerEntrypoint<Env> {
if (!section) return response;
return this.env.ASSETS.fetch(`http://fakehost/${section}/404/`);
const notFoundResponse = await this.env.ASSETS.fetch(
`http://fakehost/${section}/404/`,
);
return new Response(notFoundResponse.body, {
status: 404,
headers: notFoundResponse.headers,
});
}
return response;