Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore fileAbsolutePath to MarkdownRemark nodes fixes #4399 #4400

Merged
merged 1 commit into from
Mar 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Restore fileAbsolutePath to MarkdownRemark nodes fixes #4399
  • Loading branch information
KyleAMathews committed Mar 6, 2018
commit e30663da7e77c5fe4457e04134d067f5dbb8be3e
5 changes: 5 additions & 0 deletions packages/gatsby-transformer-remark/src/on-node-create.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ module.exports = async function onCreateNode(

markdownNode.excerpt = data.excerpt

// Add path to the markdown file path
if (node.internal.type === `File`) {
markdownNode.fileAbsolutePath = node.absolutePath
}

markdownNode.internal.contentDigest = crypto
.createHash(`md5`)
.update(JSON.stringify(markdownNode))
Expand Down