/gatsby-transformer-mdx

[WIP] Gatsby transformer plugin for JSX in Markdown using the MDX library and remark/rehype ecosystem

Primary LanguageJavaScriptMIT LicenseMIT

🚧 gatsby-transformer-mdx 🚧

Gatsby transformer plugin for MDX, heavily based on gatsby-transformer-remark.

Installation

This package isn't published yet, you should link it in order to try it out:

git clone https://github.com/silvenon/gatsby-transformer-mdx
cd gatsby-transformer-mdx
yarn
yarn build
yarn link
cd ../your-gatsby-project
yarn link gatsby-transformer-mdx

Then add it to your gatsby-config.js:

module.exports = {
  siteMetadata: {
    // ...
  },
  plugins: [
    {
      resolve: 'gatsby-source-filesystem',
      options: {
        name: 'posts',
        path: `${__dirname}/src/posts`,
      },
    },
    {
      resolve: 'gatsby-transformer-mdx',
      options: {
        remarkPlugins: [
          {
            resolve: 'gatsby-remark-smartypants',
            options: { dashes: 'oldschool' },
          },
        ],
      },
    },
  ]
}

Use .md extension!

Currently .mdx isn't supported because the mime type for that extension doesn't exist yet. I'm trying to get text/mdx (or something similar) accepted into the database. jshttp/mime-db#136