feat(docs): add static generation and search indexes

This commit is contained in:
Maofeng
2026-09-20 16:23:32 +08:00
parent a57fdbe7c6
commit 9635de56e8
19 changed files with 529 additions and 169 deletions
+4 -2
View File
@@ -21,6 +21,7 @@ import {
import { useLocale, useTranslate, type Translation } from "../lib/locale"
import { navigateToLocale } from "../lib/locale-navigation"
import { detectLocale } from "../lib/preferences"
import { usePathname } from "../lib/router"
const foregroundOptions: ReadonlyArray<{
label: Translation
@@ -54,6 +55,7 @@ const messages = {
export default function SettingsPage() {
const locale = useLocale()
const pathname = usePathname()
const t = useTranslate()
const appearance = useAppearance()
const [localeMode, setLocaleMode] = usePreference("locale-mode")
@@ -231,7 +233,7 @@ export default function SettingsPage() {
<div className="w-full space-y-1 rounded-xl border p-1 sm:w-fit sm:min-w-48 dark:border-slate-700">
<LocaleLink
disabled={autoDetectLocale}
href={getLocalizedHref(window.location.pathname, "zh-Hans")}
href={getLocalizedHref(pathname, "zh-Hans")}
label="简体中文"
locale="zh-Hans"
selected={locale === "zh-Hans"}
@@ -239,7 +241,7 @@ export default function SettingsPage() {
/>
<LocaleLink
disabled={autoDetectLocale}
href={getLocalizedHref(window.location.pathname, "en-US")}
href={getLocalizedHref(pathname, "en-US")}
label="English"
locale="en-US"
selected={locale === "en-US"}