--- import DefaultHead from '@astrojs/starlight/components/Head.astro'; // A 404 is not a translated document. Starlight would otherwise advertise // nonexistent /zh-cn/404/ and /en/404/ alternates for this custom page. if (Astro.locals.starlightRoute.id === '404' || Astro.response.status === 404) { Astro.locals.starlightRoute.head = Astro.locals.starlightRoute.head.filter( ({ tag, attrs }) => tag !== 'link' || !['canonical', 'alternate'].includes(String(attrs?.rel)), ); } /** * Google Fonts CN API, loaded without blocking first paint. * * `font-display=optional` is deliberate: if a webfont is not cached the page * renders immediately with the local fallback stacks in `fonts.generated.css` * and never swaps, so there is no reflow. A slow or blocked fonts.googleapis.cn * therefore costs nothing but the webfont itself. * * `Manrope` is the heading face behind `--sl-font-display` for the site title in * the top-left corner. A variable font, so one request spans 600..800. * `Archivo Black` is the heavy fallback; the title's Greek `Σ` needs a face with * a greek subset, which is why these two were chosen. */ const WEBFONT_CSS = 'https://fonts.googleapis.cn/css2?family=Archivo+Black&family=Manrope:wght@600..800&family=Noto+Sans+SC:wght@400..700&display=optional'; ---