Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

Commit 0b058d7

Browse files
committed
installand configure mdx, add an mdx page
1 parent 6a33bae commit 0b058d7

File tree

5 files changed

+1244
-26
lines changed

5 files changed

+1244
-26
lines changed

Diff for: gatsby-config.js

+8
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ module.exports = {
2727
icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site.
2828
},
2929
},
30+
{
31+
resolve: `gatsby-plugin-mdx`,
32+
options: {
33+
defaultLayouts: {
34+
default: require.resolve(`./src/components/layout.js`),
35+
},
36+
},
37+
},
3038
// this (optional) plugin enables Progressive Web App + Offline functionality
3139
// To learn more, visit: https://gatsby.dev/offline
3240
// `gatsby-plugin-offline`,

Diff for: package.json

+3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
"version": "0.1.0",
66
"author": "Kyle Mathews <[email protected]>",
77
"dependencies": {
8+
"@mdx-js/mdx": "^1.5.5",
9+
"@mdx-js/react": "^1.5.5",
810
"gatsby": "^2.19.7",
911
"gatsby-image": "^2.2.39",
1012
"gatsby-plugin-manifest": "^2.2.39",
13+
"gatsby-plugin-mdx": "^1.0.71",
1114
"gatsby-plugin-offline": "^3.0.32",
1215
"gatsby-plugin-react-helmet": "^3.1.21",
1316
"gatsby-plugin-sharp": "^2.4.3",

Diff for: src/pages/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const IndexPage = () => (
1414
<div style={{ maxWidth: `300px`, marginBottom: `1.45rem` }}>
1515
<Image />
1616
</div>
17-
<Link to="/page-2/">Go to page 2</Link>
17+
<Link to="/my-first-post/">Go to the MDX page</Link>
1818
</Layout>
1919
)
2020

Diff for: src/pages/my-first-post.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Let's go!

0 commit comments

Comments
 (0)