Skip to content

Commit

Permalink
Remove optional chaining.
Browse files Browse the repository at this point in the history
  • Loading branch information
paul121 committed Dec 13, 2021
1 parent e5bf9a1 commit 6842546
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ exports.createPages = async ({ graphql, actions }) => {
}
`);
result.data.allMarkdownRemark.edges.forEach(({ node }) => {
const sourceLink = node.parent.gitRemote ? node.parent.gitRemote.webLink : null;
createPage({
path: node.fields.pathname,
component: path.resolve(`./src/templates/docs-page.js`),
Expand All @@ -101,7 +102,7 @@ exports.createPages = async ({ graphql, actions }) => {
// in page queries as GraphQL variables.
pathname: node.fields.pathname,
sourceInstanceName: node.fields.sourceInstanceName,
sourceLink: node?.parent?.gitRemote?.webLink
sourceLink,
},
});
});
Expand Down

0 comments on commit 6842546

Please sign in to comment.