Skip to content

Commit

Permalink
add egghead embeds for new mdx screencasts (#21781)
Browse files Browse the repository at this point in the history
  • Loading branch information
gillkyle authored Feb 28, 2020
1 parent 068ef1b commit cb3d68a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/docs/mdx/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ Alternatively, you may be looking to configure an existing blog site to use MDX.
> `tableOfContents` and you haven't previously added a `gatsby-source-filesystem`
> pointing at `src/pages` in your project, you'll want to add one now.
<EggheadEmbed
lessonLink="https://egghead.io/lessons/gatsby-set-up-a-gatsby-site-to-use-mdx-with-gatsby-plugin-mdx-with-a-default-layout"
lessonTitle="Set up a Gatsby site to use MDX with gatsby-plugin-mdx with a default layout"
/>

## What's next?

Go check out the [writing MDX guide](/docs/mdx/writing-pages) to find out what else you can do
Expand Down
10 changes: 10 additions & 0 deletions docs/docs/mdx/importing-and-using-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ You can import your own components.

**Note**: steps for importing custom components or MDX documents from a relative location in your project are also covered in the [Writing Pages in MDX guide](/docs/mdx/writing-pages/).

<EggheadEmbed
lessonLink="https://egghead.io/lessons/gatsby-import-and-use-a-react-component-in-markdown-with-mdx"
lessonTitle="Import and use a React component in Markdown with MDX"
/>

## Make components available globally as shortcodes

To avoid having to import the same component inside of every MDX document you author, you can add components to an `MDXProvider` to make them globally available in MDX pages. This pattern is sometimes referred to as shortcodes.
Expand Down Expand Up @@ -63,6 +68,11 @@ The Chart is also available since it was passed into the MDXProvider:

Because the `<Message />` and `<Chart />` components were passed into the provider, they are available for use in all MDX documents.

<EggheadEmbed
lessonLink="https://egghead.io/lessons/gatsby-make-react-components-globally-available-as-shortcodes-in-mdx"
lessonTitle="Make React components globally available as shortcodes in MDX"
/>

### Additional resources

- Follow this detailed [example on using MDX](/examples/using-MDX) to import and render components.

0 comments on commit cb3d68a

Please sign in to comment.