Markdown redirect frontmatter

Reviewed By: danielbuechele

Differential Revision: D6987631

fbshipit-source-id: 8b3431fa885fb94d4a87119b5a5199db0b36b20c
This commit is contained in:
Emil Sjölander
2018-02-14 08:42:49 -08:00
committed by Facebook Github Bot
parent 740ef6cd9e
commit 3ec41b656f
24 changed files with 207 additions and 110 deletions

View File

@@ -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,
});
}
});
});
};