diff --git a/docs/src/gatsby-theme-apollo-docs/components/page-content.js b/docs/src/gatsby-theme-apollo-docs/components/page-content.js index 4cf8fce7111..30c26c00752 100644 --- a/docs/src/gatsby-theme-apollo-docs/components/page-content.js +++ b/docs/src/gatsby-theme-apollo-docs/components/page-content.js @@ -181,6 +181,7 @@ export default function PageContent(props) { const githubUrl = props.githubUrl.replace("tree/", "blob/") .replace("/content/", "/docs/content/") + const sourceUrl = /.+?(?=tree)/.exec(props.githubUrl) const editLink = githubUrl && ( @@ -210,6 +211,9 @@ export default function PageContent(props) { /> )} {editLink} + + Source code + ); @@ -218,11 +222,11 @@ export default function PageContent(props) { PageContent.propTypes = { children: PropTypes.node.isRequired, pathname: PropTypes.string.isRequired, - githubUrl: PropTypes.string, + githubUrl: PropTypes.string.isRequired, pages: PropTypes.array.isRequired, hash: PropTypes.string.isRequired, title: PropTypes.string.isRequired, - graphManagerUrl: PropTypes.string.isRequired, + graphManagerUrl: PropTypes.string, headings: PropTypes.array.isRequired, spectrumUrl: PropTypes.string };