Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add the latest LTS entry for the archive website #477

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions locale/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"home": "Home",
"archive-home": "Archived Docs Home",
"archive-label": "Archived Docs",
"lts-label": "Latest LTS Docs",
qiancai marked this conversation as resolved.
Show resolved Hide resolved
"tidb": "TiDB",
"tools": "Tools",
"cloud": "TiDB Cloud",
Expand Down
1 change: 1 addition & 0 deletions locale/ja/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"home": "Home",
"archive-home": "Archived Docs Home",
"archive-label": "Archived Docs",
"lts-label": "Latest LTS Docs",
qiancai marked this conversation as resolved.
Show resolved Hide resolved
"tidb": "TiDB",
"tools": "ツール",
"cloud": "TiDB Cloud",
Expand Down
1 change: 1 addition & 0 deletions locale/zh/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"home": "文档中心",
"archive-home": "归档文档中心",
"archive-label": "归档文档",
"lts-label": "最新 LTS 文档",
qiancai marked this conversation as resolved.
Show resolved Hide resolved
"tidb": "TiDB",
"tools": "生态工具",
"appdev": "开发指南",
Expand Down
48 changes: 48 additions & 0 deletions src/components/Dropdown/VersionSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,26 @@ const VersionItemsArchived = (props: {
</LinkComponent>
</MenuItem>
))}
<LinkComponent
isI18n
to={generateLTSWebsiteUrlByLangAndType(language, pathConfig.repo)}
style={{
width: "100%",
color: "#666666",
}}
>
<FormLabel
sx={{
fontSize: "0.875rem",
lineHeight: "1.25rem",
fontWeight: "bold",
pl: "0.5rem",
cursor: "pointer",
}}
>
{t("navbar.archive-label")}
qiancai marked this conversation as resolved.
Show resolved Hide resolved
</FormLabel>
</LinkComponent>
</>
);
};
Expand Down Expand Up @@ -488,3 +508,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;
}
2 changes: 2 additions & 0 deletions src/static/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";