1
1
mirror of https://github.com/jxnblk/mdx-deck.git synced 2024-12-01 21:42:08 +03:00
mdx-deck/packages/gatsby-theme/README.md
2019-04-12 15:42:07 -04:00

1.1 KiB
Raw Blame History

@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 = {
  __experimentalThemes: ['@mdx-deck/gatsby-theme'],
}

Add MDX Decks to the src/decks/ directory.

# Hello!

---

## Beep

Using Layouts

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

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 = {
  __experimentalThemes: [
    {
      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