diff --git a/index.html b/index.html index 81f4846..86582be 100644 --- a/index.html +++ b/index.html @@ -6,11 +6,46 @@ - Haoze Zhou - + + Haoze Zhou | Computer Science Student & Developer + + + + + + + + + + + + + + + + + + + + -
+
+ +
diff --git a/public/sitemap-cn.xml b/public/sitemap-cn.xml index 4d22d48..bea2a28 100644 --- a/public/sitemap-cn.xml +++ b/public/sitemap-cn.xml @@ -2,5 +2,6 @@ https://www.zhouhaoze.cn/ + 2026-08-13 diff --git a/public/sitemap.xml b/public/sitemap.xml index 86d1026..aa70712 100644 --- a/public/sitemap.xml +++ b/public/sitemap.xml @@ -2,5 +2,6 @@ https://www.zhouhaoze.com/ + 2026-08-13 diff --git a/src/i18n.ts b/src/i18n.ts index aaedac3..d036a17 100644 --- a/src/i18n.ts +++ b/src/i18n.ts @@ -1,5 +1,6 @@ import en from "./locales/en.json"; import zh from "./locales/zh.json"; +import { updateSeo } from "./seo"; export type Lang = "en" | "zh"; @@ -8,6 +9,7 @@ const dictionaries: Record> = { en, zh }; const STORAGE_KEY = "pw-lang"; function detectLang(): Lang { + if (window.location.hostname.endsWith(".cn")) return "zh"; const stored = localStorage.getItem(STORAGE_KEY); if (stored === "en" || stored === "zh") return stored; return navigator.language.toLowerCase().startsWith("zh") ? "zh" : "en"; @@ -27,7 +29,7 @@ export function t(key: string): string { export function setLang(lang: Lang): void { currentLang = lang; localStorage.setItem(STORAGE_KEY, lang); - document.documentElement.lang = lang === "zh" ? "zh-CN" : "en"; + updateSeo(lang); applyTranslations(); listeners.forEach((fn) => fn(lang)); } @@ -53,6 +55,6 @@ export function applyTranslations(): void { } export function initI18n(): void { - document.documentElement.lang = currentLang === "zh" ? "zh-CN" : "en"; + updateSeo(currentLang); applyTranslations(); } diff --git a/src/locales/en.json b/src/locales/en.json index 2c8bbc8..7d7d350 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -47,6 +47,7 @@ "projects.title": "Projects", "projects.lead": "Things I've written and maintained. Click a card for more detail.", "projects.authrouter.tag": "Featured", + "authrouter.imageAlt": "AuthRouter identity provider gateway project screenshot", "projects.authrouter.title": "AuthRouter", "projects.authrouter.desc": "Consolidates multiple identity providers behind a single login endpoint, with identity mapping across providers.", "projects.authrouter.detail": "Systems that connect to several identity providers often force users to jump between different login entry points, and identity data ends up scattered across them. AuthRouter merges these into one endpoint: callers integrate once, and requests get routed to the right upstream provider with identities mapped into a consistent format.", diff --git a/src/locales/zh.json b/src/locales/zh.json index 0f1b12b..e93bb11 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -47,6 +47,7 @@ "projects.title": "项目", "projects.lead": "一些自己写的和维护的项目,点击卡片可以看更多细节。", "projects.authrouter.tag": "重点项目", + "authrouter.imageAlt": "AuthRouter 身份提供方网关项目截图", "projects.authrouter.title": "AuthRouter", "projects.authrouter.desc": "把多个身份提供方(IdP)整合到一个统一的登录入口,只需要调用一个端点就能完成登录,并支持在不同身份提供方之间做身份映射。", "projects.authrouter.detail": "很多系统会同时接入好几个身份提供方,用户登录时经常要在不同入口之间跳转,身份信息也难以统一。AuthRouter 把这些入口整合成一个,调用方只需要对接一个端点,就能把登录请求路由到正确的上游,并把不同上游的身份信息映射成统一的格式。", diff --git a/src/main.ts b/src/main.ts index 9621668..238ef99 100644 --- a/src/main.ts +++ b/src/main.ts @@ -288,7 +288,7 @@ function renderProjects(): void {