diff --git a/apps/site/astro.config.mjs b/apps/site/astro.config.mjs index 9bef3305..42f09cd5 100644 --- a/apps/site/astro.config.mjs +++ b/apps/site/astro.config.mjs @@ -13,7 +13,21 @@ export default defineConfig({ port: 4321, host: "127.0.0.1" }, - integrations: [mdx(), sitemap(), icon(), react()], + integrations: [ + mdx(), + sitemap({ + i18n: { + defaultLocale: "zh-CN", + locales: { + "zh-CN": "zh-CN", + en: "en-US", + ja: "ja", + }, + }, + }), + icon(), + react(), + ], redirects: { "/guides/evernote-migration": "/blog/evernote-migration-guide", "/guides/memos-migration": "/blog/memos-migration-guide", @@ -21,6 +35,9 @@ export default defineConfig({ "/en/guides/evernote-migration": "/en/blog/evernote-migration-guide", "/en/guides/memos-migration": "/en/blog/memos-migration-guide", "/en/guides/notion-migration": "/en/blog/notion-migration-guide", + "/ja/guides/evernote-migration": "/en/blog/evernote-migration-guide", + "/ja/guides/memos-migration": "/en/blog/memos-migration-guide", + "/ja/guides/notion-migration": "/en/blog/notion-migration-guide", }, vite: { plugins: [tailwindcss()], diff --git a/apps/site/src/components/agent-install-tabs.astro b/apps/site/src/components/agent-install-tabs.astro index b119be13..ae89d5ba 100644 --- a/apps/site/src/components/agent-install-tabs.astro +++ b/apps/site/src/components/agent-install-tabs.astro @@ -1,9 +1,10 @@ --- import { Icon } from "astro-icon/components"; import { deploymentPrompts, manualDeploymentCopy } from "@/deployment-prompts"; +import { getLocalizedPath } from "@/i18n"; const { locale = "zh-CN" } = Astro.props; -const isEnglish = locale === "en-US"; +const isEnglish = locale !== "zh-CN"; const copy = isEnglish ? { @@ -24,7 +25,7 @@ const copy = isEnglish dockerTitle: "One-command Docker self-hosting", dockerPrerequisite: "Install Docker with Docker Compose v2 before running the command.", dockerGuide: "Open the complete Docker deployment guide", - dockerGuideHref: "/en/docker-deploy", + dockerGuideHref: getLocalizedPath(locale, "/docker-deploy"), dockerCommandLabel: "COMMAND", copyCommand: "Copy command", promptLabel: "PROMPT", diff --git a/apps/site/src/components/community-tutorial.astro b/apps/site/src/components/community-tutorial.astro index 9c5434e0..e3118a68 100644 --- a/apps/site/src/components/community-tutorial.astro +++ b/apps/site/src/components/community-tutorial.astro @@ -3,7 +3,7 @@ import { getSiteLocale } from "@/i18n"; import { Icon } from "astro-icon/components"; const locale = getSiteLocale(Astro.url.pathname); -const isEnglish = locale === "en-US"; +const isEnglish = locale !== "zh-CN"; ---