mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 01:05:58 +02:00
added a graphql field for the link to the current markdown file on github
This commit is contained in:
@@ -62,6 +62,14 @@ exports.onCreateNode = async ({ node, getNode, actions }) => {
|
||||
const { frontmatter } = node
|
||||
const isDoc = Boolean(!frontmatter.path)
|
||||
|
||||
const githubLink = helper.findMarkdownLink(node.fileAbsolutePath)
|
||||
|
||||
createNodeField({
|
||||
node,
|
||||
name: "githubLink",
|
||||
value: githubLink,
|
||||
})
|
||||
|
||||
if (!isDoc) {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user