feat(client): use custom components for guide articles

This commit is contained in:
Valeriy
2019-02-04 03:46:27 +03:00
committed by Stuart Taylor
parent 54e6f4d6ae
commit 6a93b44aca
4 changed files with 91 additions and 47 deletions

View File

@@ -30,12 +30,15 @@ exports.onCreateNode = function onCreateNode({ node, actions, getNode }) {
}
if (node.internal.type === 'MarkdownRemark') {
let slug = createFilePath({ node, getNode });
const slug = createFilePath({ node, getNode });
if (!slug.includes('LICENSE')) {
const {
frontmatter: { component = '' }
} = node;
createNodeField({ node, name: 'slug', value: slug });
createNodeField({ node, name: 'component', value: component });
}
}
};
exports.createPages = function createPages({ graphql, actions }) {
@@ -75,6 +78,7 @@ exports.createPages = function createPages({ graphql, actions }) {
fields {
slug
nodeIdentity
component
}
frontmatter {
block