The fastest way to get started with Gatsby+MDX is to use the MDX starter. This allows you to write .mdx files in src/pages to create new pages on your site.

🚀 Quick start

  1. Create a Gatsby MDX site.

    Use the Gatsby CLI to create a new site, specifying the MDX starter.

    npx gatsby new my-mdx-starter
  2. Start developing.

    Navigate into your new site’s directory and start it up.

    cd my-mdx-starter/
    npm install
    gatsby develop
  3. Open the source code and start editing!

    Your site is now running at http://localhost:8000!

    Note: You'll also see a second link: http://localhost:8000/___graphql. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the Gatsby tutorial.

    Open the my-mdx-starter directory in your code editor of choice and edit src/pages/index.mdx. Save your changes and the browser will update in real time!

Now go check out the guides to find out what else you can do with Gatsby and MDX!

edit this page on GitHub