Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
Add OLD_SITE_DOMAIN
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Nov 13, 2019
1 parent 342fc70 commit 71e6bb8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion @antv/gatsby-theme-antv/site/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { getProducts } from './getProducts';
import styles from './Footer.module.less';
import 'rc-footer/assets/index.less';

export const OLD_SITE_DOMAIN = 'https://antv-2018.alipay.com';

interface FooterProps extends RcFooterProps {
rootDomain?: string;
language?: string;
Expand Down Expand Up @@ -141,7 +143,7 @@ const Footer: React.FC<FooterProps> = ({
<Icon type="github" />
</a>
<a href={`${rootDomain}/about`}>{t('关于我们')}</a>
<a href="https://antv-2018.alipay.com" target="_blank">
<a href={OLD_SITE_DOMAIN} target="_blank">
{t('返回旧版')}
</a>
</div>
Expand Down
4 changes: 2 additions & 2 deletions @antv/gatsby-theme-antv/site/layouts/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { initReactI18next } from 'react-i18next';
import { getCurrentLangKey } from 'ptz-i18n';
import Helmet from 'react-helmet';
import Header from '../components/Header';
import Footer from '../components/Footer';
import Footer, { OLD_SITE_DOMAIN } from '../components/Footer';
import styles from './layout.module.less';

i18n
Expand Down Expand Up @@ -92,7 +92,7 @@ const Layout: React.FC<LayoutProps> = ({ children, location }) => {
rediectUrl = to;
} else {
// 如果没有指定 to,则直接用替换成老版本的域名
rediectUrl = `https://antv-2018.alipay.com${location.pathname}`;
rediectUrl = `${OLD_SITE_DOMAIN}${location.pathname}`;
}
}
},
Expand Down

0 comments on commit 71e6bb8

Please sign in to comment.