feat: integrate Astro fonts API with Google Sans Code font (#602)

- Add Google Sans Code font and make it the default font
- Font is preloaded with latin subset and weight 400 and style normal for optimal performance
- Add font configuration section in how to config docs
This commit is contained in:
Sat Naing
2026-01-10 21:08:31 +07:00
committed by GitHub
parent 5bb8e405bb
commit 698295d23d
5 changed files with 93 additions and 5 deletions
+7
View File
@@ -1,4 +1,5 @@
---
import { Font } from "astro:assets";
import { ClientRouter } from "astro:transitions";
import { PUBLIC_GOOGLE_SITE_VERIFICATION } from "astro:env/client";
import { SITE } from "@/config";
@@ -60,6 +61,12 @@ const structuredData = {
<link rel="canonical" href={canonicalURL} />
<meta name="generator" content={Astro.generator} />
<!-- Load Font -->
<Font
cssVariable="--font-google-sans-code"
preload={[{ subset: "latin", weight: 400, style: "normal" }]}
/>
<!-- General Meta Tags -->
<title>{title}</title>
<meta name="title" content={title} />