Browse Source

site: Add 4.x url (#23130)

* docs: add 4.x url in 3.x page

* add s
pull/23382/head
xrkffgg 5 years ago
committed by GitHub
parent
commit
2c8107c8bd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      site/bisheng.config.js
  2. 12
      site/theme/template/Layout/Header.jsx

13
site/bisheng.config.js

@ -66,12 +66,15 @@ module.exports = {
废弃: 7,
},
docVersions: {
'0.9.x': 'http://09x.ant.design',
'0.10.x': 'http://010x.ant.design',
'0.11.x': 'http://011x.ant.design',
'0.12.x': 'http://012x.ant.design',
'1.x': 'http://1x.ant.design',
'2.x': 'http://2x.ant.design',
'1.x': 'http://1x.ant.design',
'0.12.x': 'http://012x.ant.design',
'0.11.x': 'http://011x.ant.design',
'0.10.x': 'http://010x.ant.design',
'0.9.x': 'http://09x.ant.design',
},
docNewVersions: {
'4.x': 'https://ant.design',
},
},
filePathMapper(filePath) {

12
site/theme/template/Layout/Header.jsx

@ -108,8 +108,16 @@ class Header extends React.Component {
const { menuVisible } = this.state;
const { isMobile } = this.context;
const menuMode = isMobile ? 'inline' : 'horizontal';
const { location, themeConfig, intl: { locale } } = this.props;
const docVersions = { ...themeConfig.docVersions, [antdVersion]: antdVersion };
const {
location,
themeConfig,
intl: { locale },
} = this.props;
const docVersions = {
...themeConfig.docNewVersions,
[antdVersion]: antdVersion,
...themeConfig.docVersions,
};
const versionOptions = Object.keys(docVersions).map(version => (
<Option value={docVersions[version]} key={version}>
{version}

Loading…
Cancel
Save