Markdown redirect frontmatter
Reviewed By: danielbuechele Differential Revision: D6987631 fbshipit-source-id: 8b3431fa885fb94d4a87119b5a5199db0b36b20c
This commit is contained in:
committed by
Facebook Github Bot
parent
740ef6cd9e
commit
3ec41b656f
@@ -26,6 +26,7 @@ exports.createPages = ({boundActionCreators, graphql}) => {
|
||||
path
|
||||
hasPlayground
|
||||
initialPlayground
|
||||
redirect
|
||||
}
|
||||
html
|
||||
}
|
||||
@@ -38,13 +39,15 @@ exports.createPages = ({boundActionCreators, graphql}) => {
|
||||
}
|
||||
|
||||
result.data.allMarkdownRemark.edges.forEach(({node}) => {
|
||||
createPage({
|
||||
path: node.frontmatter.path,
|
||||
component: node.frontmatter.hasPlayground
|
||||
? withPlayground
|
||||
: withoutPlayground,
|
||||
context: node,
|
||||
});
|
||||
if (!node.frontmatter.redirect) {
|
||||
createPage({
|
||||
path: node.frontmatter.path,
|
||||
component: node.frontmatter.hasPlayground
|
||||
? withPlayground
|
||||
: withoutPlayground,
|
||||
context: node,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
Reference in New Issue
Block a user