feat(guide): add footer link to article source on GitHub
fix/suggested-changes
This commit is contained in:
@ -4,6 +4,7 @@ const { createFilePath } = require('gatsby-source-filesystem');
|
||||
|
||||
const { dasherize } = require('./utils');
|
||||
const { blockNameify } = require('./utils/blockNameify');
|
||||
const { getGithubPath } = require('./utils/getGithubPath');
|
||||
const {
|
||||
createChallengePages,
|
||||
createBlockIntroPages,
|
||||
@ -33,10 +34,16 @@ exports.onCreateNode = function onCreateNode({ node, actions, getNode }) {
|
||||
const slug = createFilePath({ node, getNode });
|
||||
if (!slug.includes('LICENSE')) {
|
||||
const {
|
||||
fileAbsolutePath,
|
||||
frontmatter: { component = '' }
|
||||
} = node;
|
||||
createNodeField({ node, name: 'slug', value: slug });
|
||||
createNodeField({ node, name: 'component', value: component });
|
||||
createNodeField({
|
||||
node,
|
||||
name: 'githubPath',
|
||||
value: getGithubPath(fileAbsolutePath)
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -79,6 +86,7 @@ exports.createPages = function createPages({ graphql, actions }) {
|
||||
slug
|
||||
nodeIdentity
|
||||
component
|
||||
githubPath
|
||||
}
|
||||
frontmatter {
|
||||
block
|
||||
|
Reference in New Issue
Block a user