Skip to content

Commit

Permalink
site: fix routes
Browse files Browse the repository at this point in the history
  • Loading branch information
benjycui committed May 6, 2016
1 parent 0283f61 commit c23d724
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 5 additions & 0 deletions site/entry/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion site/entry/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(/^\//, '');
Expand Down
6 changes: 1 addition & 5 deletions site/website.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit c23d724

Please sign in to comment.