Skip to content

Commit

Permalink
Fix 404 for warning URLs (#11038)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored Oct 2, 2017
1 parent 4c8d248 commit bbb272f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 7 additions & 2 deletions www/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,19 @@ exports.createPages = async ({graphql, boundActionCreators}) => {
slug.includes('community/') ||
slug.includes('contributing/') ||
slug.includes('docs/') ||
slug.includes('tutorial/')
slug.includes('tutorial/') ||
slug.includes('warnings/')
) {
let template;
if (slug.includes('blog/')) {
template = blogTemplate;
} else if (slug.includes('community/')) {
template = communityTemplate;
} else if (slug.includes('contributing/') || slug.includes('docs/')) {
} else if (
slug.includes('contributing/') ||
slug.includes('docs/') ||
slug.includes('warnings/')
) {
template = docsTemplate;
} else if (slug.includes('tutorial/')) {
template = tutorialTemplate;
Expand Down
4 changes: 3 additions & 1 deletion www/src/layouts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ class Template extends Component {
// TODO - is there a better way to check if we need we have a sidebar?
let layoutHasSidebar = false;
if (
location.pathname.match(/^\/(docs|tutorial|community|blog|contributing)/)
location.pathname.match(
/^\/(docs|tutorial|community|blog|contributing|warnings)/,
)
) {
layoutHasSidebar = true;
}
Expand Down

0 comments on commit bbb272f

Please sign in to comment.