Skip to content

Commit 95e6a1e

Browse files
committed
Fix nav
1 parent 035e762 commit 95e6a1e

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

antwar.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@ module.exports = {
4444
},
4545
layout: () => require('./src/components/Page/Page.jsx').default
4646
},
47+
'api/plugins': {
48+
title: "API Plugins",
49+
content: () => require.context('./loaders/page-loader!./src/content/api/plugins', false, /^\.\/.*\.md$/),
50+
redirects: {
51+
'passing-a-config': 'configuration-types'
52+
},
53+
url: ({ sectionName, fileName }) => `/${sectionName}/${fileName}/`,
54+
transform: (pages) => {
55+
return _.sortBy(pages, (page) => page.file.sort)
56+
},
57+
layout: () => require('./src/components/Page/Page.jsx').default
58+
},
4759
pluginsapi: {
4860
title: 'API Plugin',
4961
redirects: {

src/components/Navigation/Navigation.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ export default class Navigation extends React.Component {
171171
let { pageUrl = '' } = this.props;
172172

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

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

179179
/**

src/content/index.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,10 @@ __page.html__
5656
</html>
5757
```
5858

59-
</div>
60-
6159
Then run `webpack` on the command-line to create `bundle.js`.
60+
</div>
61+
</div>
6262

6363
## It's that simple
6464

6565
__[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.
66-
67-
</div>
68-

0 commit comments

Comments
 (0)