Skip to content

Commit

Permalink
Fix nav
Browse files Browse the repository at this point in the history
  • Loading branch information
pierreneter committed Aug 30, 2017
1 parent 035e762 commit 95e6a1e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
12 changes: 12 additions & 0 deletions antwar.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ module.exports = {
},
layout: () => require('./src/components/Page/Page.jsx').default
},
'api/plugins': {
title: "API Plugins",
content: () => require.context('./loaders/page-loader!./src/content/api/plugins', false, /^\.\/.*\.md$/),
redirects: {
'passing-a-config': 'configuration-types'
},
url: ({ sectionName, fileName }) => `/${sectionName}/${fileName}/`,
transform: (pages) => {
return _.sortBy(pages, (page) => page.file.sort)
},
layout: () => require('./src/components/Page/Page.jsx').default
},
pluginsapi: {
title: 'API Plugin',
redirects: {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Navigation/Navigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ export default class Navigation extends React.Component {
let { pageUrl = '' } = this.props;

if (section.children) {
return section.children.some(child => { return pageUrl == '/' + child.url + '/'; });
return section.children.some(child => { return (new RegExp("^/" + child.url +".*/")).test(pageUrl); });

} else return pageUrl.includes('/' + section.url + '/', 0);
} else return (new RegExp("^/" + section.url +".*/")).test(pageUrl);
}

/**
Expand Down
7 changes: 2 additions & 5 deletions src/content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,10 @@ __page.html__
</html>
```

</div>

Then run `webpack` on the command-line to create `bundle.js`.
</div>
</div>

## It's that simple

__[Get Started](/guides/getting-started)__ quickly in our __Guides__ section, or dig into the __[Concepts](/concepts)__ section for more high-level information on the core notions behind behind webpack.

</div>

0 comments on commit 95e6a1e

Please sign in to comment.