Skip to content

Commit

Permalink
chore(docs): Update migrate-remark-to-mdx (#28811)
Browse files Browse the repository at this point in the history
Co-authored-by: Lennart <lekoarts@gmail.com>
  • Loading branch information
Taremeh and LekoArts authored Jan 4, 2021
1 parent 3d6446c commit 7a1697c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/docs/how-to/routing/migrate-remark-to-mdx.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ const result = await graphql(
) {
```

Don't forget to update the `posts` constant by replacing `allMarkdownRemark` with `allMdx`.
```diff:title=gatsby-node.js
-const posts = result.data.allMarkdownRemark.nodes
+const posts = result.data.allMdx.nodes
```
Also, update `onCreateNode` which creates the blog post slugs to watch for the node type of `Mdx` instead of `MarkdownRemark`.
```diff:title=gatsby-node.js
Expand Down

0 comments on commit 7a1697c

Please sign in to comment.