mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fix 404 for warning URLs (#11038)
This commit is contained in:
+7
-2
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user