2.5.0 • Published 5 years ago

@mdx-deck/gatsby-theme v2.5.0

Weekly downloads
2
License
MIT
Repository
-
Last release
5 years ago

@mdx-deck/gatsby-theme

WIP A Gatsby theme for adding MDX Decks to your Gatsby site

npm i @mdx-deck/gatsby-theme

Note: This theme requires MDX v1 and will not work with previous versions of MDX

// gatsby-config.js
module.exports = {
  plugins: ['@mdx-deck/gatsby-theme'],
}

Add MDX Decks to the src/decks/ directory. The filename will be used for the route of that deck.

/src/decks/hello.mdx

# Hello!

---

## Beep

Using Layouts

Slide layout components must be rendered inline, not using the default export syntax.

/src/decks/hello.mdx

import Layout from './my-layout'

<Layout>

# Hello Layout

</Layout>

Theme Config

The following options can be passed to the gatsby theme.

// gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: '@mdx-deck/gatsby-theme',
      options: {
        // disable gatsby-mdx plugin – use this when your site already uses gatsby-mdx
        mdx: false,
        // source directory for decks
        path: 'src/presentations',
        // name routes' basepath
        name: 'presentations',
      },
    },
  ],
}

MIT License