-
+ codeSandboxLinks.forEach(link => {
+ link.onclick = e => {
+ const codeBlock = link.previousSibling;
+
+ if (codeBlock && codeBlock.className === 'gatsby-highlight') {
+ const [child] = codeBlock.children;
+ if (child && child.tagName !== 'IFRAME') {
+ e.preventDefault();
+
+ link.textContent = 'Open in CodeSandbox.';
+ codeBlock.innerHTML = `
`;
+ }
+ }
+ };
+ });
+ }
- {markdownRemark.fields.path && (
-
-
- Edit this page
-
+ render() {
+ const {
+ authors,
+ createLink,
+ date,
+ enableScrollSync,
+ ogDescription,
+ location,
+ markdownRemark,
+ sectionList,
+ titlePostfix = '',
+ } = this.props;
+
+ const hasAuthors = authors.length > 0;
+ const titlePrefix = markdownRemark.frontmatter.title || '';
+
+ return (
+
+
+
+
+
+
+
+
+ {(date || hasAuthors) && (
+
)}
+
+
+
+
+ {markdownRemark.fields.path && (
+
+ )}
+
+
+
+
+
-
-
-
-
-
-
-
-
- {/* TODO Read prev/next from index map, not this way */}
- {(markdownRemark.frontmatter.next || markdownRemark.frontmatter.prev) && (
-
- )}
-
- );
-};
+
+
+
+ {/* TODO Read prev/next from index map, not this way */}
+ {(markdownRemark.frontmatter.next ||
+ markdownRemark.frontmatter.prev) && (
+
+ )}
+
+ );
+ }
+}
MarkdownPage.defaultProps = {
authors: [],
diff --git a/yarn.lock b/yarn.lock
index a86fa6c6bd7..cf05322b173 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2332,14 +2332,6 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4:
safe-buffer "^5.0.1"
sha.js "^2.4.8"
-create-react-class@^15.6.0:
- version "15.6.2"
- resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.2.tgz#cf1ed15f12aad7f14ef5f2dfe05e6c42f91ef02a"
- dependencies:
- fbjs "^0.8.9"
- loose-envify "^1.3.1"
- object-assign "^4.1.1"
-
cross-env@^3.1.1:
version "3.2.4"
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-3.2.4.tgz#9e0585f277864ed421ce756f81a980ff0d698aba"
@@ -3942,6 +3934,15 @@ gatsby-remark-autolink-headers@^1.4.4:
mdast-util-to-string "^1.0.2"
unist-util-visit "^1.1.1"
+gatsby-remark-codesandbox@^1.2.23:
+ version "1.2.23"
+ resolved "https://registry.yarnpkg.com/gatsby-remark-codesandbox/-/gatsby-remark-codesandbox-1.2.23.tgz#7da743b0160bf6ef0a8518f9fab4de5881e98741"
+ dependencies:
+ babel-runtime "^6.26.0"
+ git-branch "^1.0.0"
+ git-username "^0.5.0"
+ unist-util-visit "^1.1.1"
+
gatsby-remark-copy-linked-files@^1.5.2:
version "1.5.7"
resolved "https://registry.yarnpkg.com/gatsby-remark-copy-linked-files/-/gatsby-remark-copy-linked-files-1.5.7.tgz#59817877cb2978a6a72df62f2353033f0f8a6e35"
@@ -4217,6 +4218,16 @@ getpass@^0.1.1:
dependencies:
assert-plus "^1.0.0"
+git-branch@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/git-branch/-/git-branch-1.0.0.tgz#64cc7dd75da2d81a9d4679087c1f8b56e6bd2d3d"
+
+git-username@^0.5.0:
+ version "0.5.0"
+ resolved "https://registry.yarnpkg.com/git-username/-/git-username-0.5.0.tgz#38c561dac9cbf334097a31bd9a38af0cb40a3123"
+ dependencies:
+ remote-origin-url "^0.4.0"
+
github-slugger@^1.1.1:
version "1.1.3"
resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-1.1.3.tgz#314a6e759a18c2b0cc5760d512ccbab549c549a7"
@@ -4438,7 +4449,7 @@ graphql-skip-limit@^1.0.5:
dependencies:
babel-runtime "^6.26.0"
-graphql@^0.10.3, graphql@^0.10.5:
+graphql@0.10.5, graphql@^0.10.3, graphql@^0.10.5:
version "0.10.5"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-0.10.5.tgz#c9be17ca2bdfdbd134077ffd9bbaa48b8becd298"
dependencies:
@@ -4910,7 +4921,7 @@ inherits@2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1"
-ini@^1.3.4, ini@~1.3.0:
+ini@^1.3.3, ini@^1.3.4, ini@~1.3.0:
version "1.3.4"
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e"
@@ -6801,6 +6812,12 @@ parse-filepath@^1.0.1:
map-cache "^0.2.0"
path-root "^0.1.1"
+parse-git-config@^0.2.0:
+ version "0.2.0"
+ resolved "https://registry.yarnpkg.com/parse-git-config/-/parse-git-config-0.2.0.tgz#272833fdd15fea146fb75d336d236b963b6ff706"
+ dependencies:
+ ini "^1.3.3"
+
parse-glob@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c"
@@ -7755,16 +7772,7 @@ react-deep-force-update@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/react-deep-force-update/-/react-deep-force-update-2.0.1.tgz#4f7f6c12c3e7de42f345992a3c518236fa1ecad3"
-react-dom@^15.6.0:
- version "15.6.2"
- resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-15.6.2.tgz#41cfadf693b757faf2708443a1d1fd5a02bef730"
- dependencies:
- fbjs "^0.8.9"
- loose-envify "^1.1.0"
- object-assign "^4.1.0"
- prop-types "^15.5.10"
-
-react-dom@^16.0.0:
+react-dom@16.0.0, react-dom@^15.6.0, react-dom@^16.0.0:
version "16.0.0"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.0.0.tgz#9cc3079c3dcd70d4c6e01b84aab2a7e34c303f58"
dependencies:
@@ -7827,17 +7835,7 @@ react-side-effect@^1.1.0:
exenv "^1.2.1"
shallowequal "^1.0.1"
-react@^15.6.0:
- version "15.6.2"
- resolved "https://registry.yarnpkg.com/react/-/react-15.6.2.tgz#dba0434ab439cfe82f108f0f511663908179aa72"
- dependencies:
- create-react-class "^15.6.0"
- fbjs "^0.8.9"
- loose-envify "^1.1.0"
- object-assign "^4.1.0"
- prop-types "^15.5.10"
-
-react@^16.0.0:
+react@16.0.0, react@^15.6.0, react@^16.0.0:
version "16.0.0"
resolved "https://registry.yarnpkg.com/react/-/react-16.0.0.tgz#ce7df8f1941b036f02b2cca9dbd0cb1f0e855e2d"
dependencies:
@@ -8130,6 +8128,12 @@ remarkable@^1.7.1:
argparse "~0.1.15"
autolinker "~0.15.0"
+remote-origin-url@^0.4.0:
+ version "0.4.0"
+ resolved "https://registry.yarnpkg.com/remote-origin-url/-/remote-origin-url-0.4.0.tgz#4d3e2902f34e2d37d1c263d87710b77eb4086a30"
+ dependencies:
+ parse-git-config "^0.2.0"
+
remote-redux-devtools@^0.5.7:
version "0.5.12"
resolved "https://registry.yarnpkg.com/remote-redux-devtools/-/remote-redux-devtools-0.5.12.tgz#42cb95dfa9e54c1d9671317c5e7bba41e68caec2"