diff --git a/locale/en/translation.json b/locale/en/translation.json index 2bf4850ab..d2082ad00 100644 --- a/locale/en/translation.json +++ b/locale/en/translation.json @@ -20,6 +20,7 @@ "home": "Home", "archive-home": "Archived Docs Home", "archive-label": "Archived Docs", + "ltsLabel": "Latest LTS Docs", "tidb": "TiDB", "tools": "Tools", "cloud": "TiDB Cloud", diff --git a/locale/ja/translation.json b/locale/ja/translation.json index b503d6f21..a31b2caf3 100644 --- a/locale/ja/translation.json +++ b/locale/ja/translation.json @@ -21,6 +21,7 @@ "home": "Home", "archive-home": "Archived Docs Home", "archive-label": "Archived Docs", + "ltsLabel": "Latest LTS Docs", "tidb": "TiDB", "tools": "ツール", "cloud": "TiDB Cloud", diff --git a/locale/zh/translation.json b/locale/zh/translation.json index 8bd589154..5863b76ba 100644 --- a/locale/zh/translation.json +++ b/locale/zh/translation.json @@ -18,6 +18,7 @@ "home": "文档中心", "archive-home": "归档文档中心", "archive-label": "归档文档", + "ltsLabel": "最新 LTS 文档", "tidb": "TiDB", "tools": "生态工具", "appdev": "开发指南", diff --git a/src/components/Dropdown/VersionSelect.tsx b/src/components/Dropdown/VersionSelect.tsx index 8dd8fc903..22e9ce64f 100644 --- a/src/components/Dropdown/VersionSelect.tsx +++ b/src/components/Dropdown/VersionSelect.tsx @@ -16,6 +16,7 @@ import ChevronRightIcon from "@mui/icons-material/ChevronRight"; import { PathConfig, BuildType } from "static/Type"; import { ARCHIVE_WEBSITE_URL } from "static"; +import { LTS_WEBSITE_URL } from "static"; import { AllVersion } from "utils"; import CONFIG from "../../../docs/docs.json"; import LinkComponent from "components/Link"; @@ -295,6 +296,26 @@ const VersionItemsArchived = (props: { ))} + + + {t("navbar.ltsLabel")} + + ); }; @@ -488,3 +509,31 @@ function generateArchivedWebsiteUrlByLangAndType(lang?: string, type?: string) { return url; } + +function generateLTSWebsiteUrlByLangAndType(lang?: string, type?: string) { + let url = LTS_WEBSITE_URL; + + switch (lang) { + case "zh": + url = `${LTS_WEBSITE_URL}/zh`; + break; + case "jp": + url = `${LTS__WEBSITE_URL}/jp`; + break; + default: + break; + } + switch (type) { + case "tidb-in-kubernetes": + url = `${url}/tidb-in-kubernetes/stable`; + break; + case "tidb-data-migration": + url = `${url}/tidb/stable/dm-overview`; + break; + default: + url = `${url}/tidb/stable`; + break; + } + + return url; +} diff --git a/src/static/index.ts b/src/static/index.ts index 8b3cdc6a3..b18326c7e 100644 --- a/src/static/index.ts +++ b/src/static/index.ts @@ -539,3 +539,5 @@ export const ZH_DOC_TYPE_LIST = [ ]; export const ARCHIVE_WEBSITE_URL = "https://docs-archive.pingcap.com"; + +export const LTS_WEBSITE_URL = "https://docs.pingcap.com";