© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2021
N. BiswasExtending Gatsbyhttps://doi.org/10.1007/978-1-4842-6855-1_2

2. Adding gatsby-plugin-mdx to the Site

Nabendu Biswas1  
(1)
Bhopal, India
 

In this chapter we will add gatsby-plugin-mdx to our project. It will help to display MDX blogs in the project. We’ll also be generating the pages programmatically and then coding them. MDX files are an updated form of markdown files, where you can also use react JSX.

Getting Started

Per the documentation, install the plug-in by running the following command.
npm install --save gatsby-plugin-mdx @mdx-js/mdx @mdx-js/react
After that, add the basic configuration in the gatsby-config.js file , as shown in Listing 2-1. Don’t ...

Get Extending Gatsby: Create a Blog Site Using MDX, CDN, and Netlify now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.