mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 03:29:39 +08:00
site: fix routes
This commit is contained in:
parent
0283f61bba
commit
c23d724ab9
@ -55,6 +55,11 @@ ReactDOM.render(
|
||||
component={utils.getChildrenWrapper(reactComponents)} />
|
||||
</Route>
|
||||
{redirects}
|
||||
<Route path="docs/react" component={ReactComponents}>
|
||||
{utils.generateIndex(reactComponents)}
|
||||
<Route path=":children"
|
||||
component={utils.getChildrenWrapper(reactComponents)} />
|
||||
</Route>
|
||||
<Route path="docs/practice" component={Practice}>
|
||||
{utils.generateIndex(practice)}
|
||||
<Route path=":children"
|
||||
|
@ -60,7 +60,7 @@ export function generateIndex(data) {
|
||||
|
||||
const pathToFile = {};
|
||||
Object.keys(redirects).forEach((key) => pathToFile[redirects[key]] = key);
|
||||
pathToFile['components/changelog'] = './CHANGELOG'; // TODO
|
||||
pathToFile['docs/react/changelog'] = './CHANGELOG'; // TODO
|
||||
export function getChildrenWrapper(data) {
|
||||
return function childrenWrapper(props) {
|
||||
const trimedPathname = props.location.pathname.replace(/^\//, '');
|
||||
|
@ -15,11 +15,7 @@ export default {
|
||||
},
|
||||
|
||||
redirects: {
|
||||
'docs/react/introduce': 'components/introduce',
|
||||
'docs/react/getting-started': 'components/getting-started',
|
||||
'docs/react/install': 'components/install',
|
||||
'docs/react/upgrade-notes': 'components/upgrade-notes',
|
||||
CHANGELOG: 'components/changelog',
|
||||
CHANGELOG: 'docs/react/changelog',
|
||||
},
|
||||
|
||||
docVersions: {
|
||||
|
Loading…
Reference in New Issue
Block a user