From cce78260c3897c4d495eaa0e240fe38a95cf46c5 Mon Sep 17 00:00:00 2001 From: ClovertaTheTrilobita Date: Fri, 17 Apr 2026 13:42:26 +0300 Subject: [PATCH] fix html lang and font --- src/layouts/BaseLayout.astro | 8 ++++++-- src/styles/global.css | 8 +++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index 6430ed4..009b485 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -2,7 +2,11 @@ import Footer from "@/components/Footer.astro"; import Header from "@/components/Header.astro"; import { ClientRouter } from "astro:transitions"; -import { slide, fade } from "astro:transitions"; +import { fade } from "astro:transitions"; +import { getLangFromUrl } from "@/i18n"; + +const lang = getLangFromUrl(Astro.url); +const htmlLang = lang === "zh" ? "zh-CN" : "en-US"; import SEO from "@/components/SEO.astro"; import FloatingActions from "@/components/FloatingActions.astro"; import Spinner from "@/components/Spinner.astro"; @@ -15,7 +19,7 @@ const { --- - + diff --git a/src/styles/global.css b/src/styles/global.css index ec220d1..3536dc8 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -34,7 +34,13 @@ article svg[id^="mermaid-"] { html { /* font-family: "Maple Mono", "Maple Mono CN", monospace; */ - font-family: 'Noto Serif SC', serif; + font-family: + "Noto Serif SC", + "Source Han Serif SC", + "Songti SC", + "STSong", + "SimSun", + serif; font-weight: 500; /* background-color: #ffffff; */ background-color: #F9F2ED;