The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 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 | }); |