The best way to control Claude Code, Codex and more from any computer or phone

main
ts 16 lines 791 Bytes
Raw
1 /// <reference types="@astrojs/starlight/locals" />
2 import { defineRouteMiddleware } from "@astrojs/starlight/route-data";
3 import type { StarlightRouteData } from "@astrojs/starlight/route-data";
4
5 /**
6 * Starlight always emits a single `<link rel="shortcut icon">` from its
7 * `favicon` config. Drop it so the per-theme set in `brand/Icons.astro`
8 * (rendered by the `Head` override) is the only icon the browser sees.
9 */
10 export const onRequest = defineRouteMiddleware((context) => {
11 // `locals` isn't ambient-typed in this project (see docs-tabs-sidebar.ts).
12 const { starlightRoute } = context.locals as { starlightRoute: StarlightRouteData };
13 starlightRoute.head = starlightRoute.head.filter(
14 (entry) => !(entry.tag === "link" && entry.attrs?.rel === "shortcut icon"),
15 );
16 });