docs: auto use Chinese mirror if in mirror (#38776)

* docs: auto use chinese mirror if in mirror

* Update .dumi/theme/themeConfig.ts

* Update .dumi/theme/themeConfig.ts

Co-authored-by: Amumu <yoyo837@hotmail.com>
This commit is contained in:
二货爱吃白萝卜 2022-11-21 14:00:32 +08:00 committed by GitHub
parent bac41780ef
commit 0c446bc9c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -54,7 +54,7 @@ export default function BannerRecommends({ extras = [], icons = [] }: BannerReco
>
{first3.map((extra, index) => {
if (!extra) {
return <Skeleton />;
return <Skeleton key={index} />;
}
const icon = icons.find((icon) => icon.name === extra.source);
return (

View File

@ -1,3 +1,6 @@
const chineseMirror =
typeof location !== 'undefined' && location.hostname.includes('.antgroup.com');
export default {
categoryOrder: {
'Ant Design': 0,
@ -43,7 +46,7 @@ export default {
'Template Document': 3,
},
docVersions: {
'4.x': 'https://4x.ant.design',
'4.x': chineseMirror ? 'https://4x-ant-design.antgroup.com/' : 'https://4x.ant.design',
'3.x': 'https://3x.ant.design',
'2.x': 'https://2x.ant.design',
'1.x': 'https://1x.ant.design',