Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add egghead embeds for new mdx screencasts #21781

Merged
merged 2 commits into from
Feb 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.