Update on-create-node.js

This commit is contained in:
alxshelepenok 2018-11-13 00:28:02 +03:00
parent 03d84009be
commit 0338cd2844

View File

@ -10,7 +10,6 @@ const onCreateNode = ({ node, actions, getNode }) => {
fmImagesToRelative(node);
if (node.internal.type === 'MarkdownRemark') {
console.log(node.frontmatter);
if (typeof node.frontmatter.slug !== 'undefined') {
createNodeField({
node,
@ -20,9 +19,9 @@ const onCreateNode = ({ node, actions, getNode }) => {
} else {
const value = createFilePath({ node, getNode });
createNodeField({
name: 'slug',
node,
value,
name: 'slug',
value
});
}