-
-
Save christiannwamba/2d8ccec573564b9b1ae4779ca6934d0f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { createFilePath } = require(`gatsby-source-filesystem`) | |
const path = require(‘path’) | |
exports.onCreateNode = ({ node, getNode, boundActionCreators }) => { | |
const { createNodeField } = boundActionCreators | |
if (node.internal.type === `MarkdownRemark`) { | |
const slug = createFilePath({ node, getNode, basePath: `pages` }) | |
createNodeField({ | |
node, | |
name: `slug`, | |
value: slug, | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment