mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2025-03-13 19:09:11 +01:00
Update on-create-node.js
This commit is contained in:
parent
03d84009be
commit
0338cd2844
@ -10,7 +10,6 @@ const onCreateNode = ({ node, actions, getNode }) => {
|
|||||||
fmImagesToRelative(node);
|
fmImagesToRelative(node);
|
||||||
|
|
||||||
if (node.internal.type === 'MarkdownRemark') {
|
if (node.internal.type === 'MarkdownRemark') {
|
||||||
console.log(node.frontmatter);
|
|
||||||
if (typeof node.frontmatter.slug !== 'undefined') {
|
if (typeof node.frontmatter.slug !== 'undefined') {
|
||||||
createNodeField({
|
createNodeField({
|
||||||
node,
|
node,
|
||||||
@ -20,9 +19,9 @@ const onCreateNode = ({ node, actions, getNode }) => {
|
|||||||
} else {
|
} else {
|
||||||
const value = createFilePath({ node, getNode });
|
const value = createFilePath({ node, getNode });
|
||||||
createNodeField({
|
createNodeField({
|
||||||
name: 'slug',
|
|
||||||
node,
|
node,
|
||||||
value,
|
name: 'slug',
|
||||||
|
value
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user