jxnblk/mdx-deck

Default layouts are not working with `gatsby-theme-mdx-deck`

Open

#466 aberto em 5 de set. de 2019

Ver no GitHub
 (2 comments) (0 reactions) (0 assignees)JavaScript (662 forks)batch import
bughelp wanted

Métricas do repositório

Stars
 (11.169 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

Default layouts are not working with MDX Deck.

Example repo

// gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: 'gatsby-theme-mdx-deck',
      options: {
        contentPath: './src/decks',
        basePath: '/',
      }
    },
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `decks`,
        path: `${__dirname}/src/decks/`,
      },
    },
    {
      resolve: `gatsby-plugin-page-creator`,
      options: {
        path: `${__dirname}/src/decks`,
      },
    },
    {
      resolve: `gatsby-plugin-mdx`,
      options: {
        defaultLayouts: {
          default: require.resolve(`./src/components/Layout.js`),
        }
      }
    }
  ]
}
// Layout.js
import React from 'react'
import HeaderButton from './HeaderButton'

export default ({ children }) => (
  <>
    <HeaderButton />

    { children }
  </>
)
Syntax Error: SyntaxError: unknown: Identifier '_frontmatter' has already been declared (111:13)

  109 | MDXContent.isMDXComponent = true;
  110 |
> 111 | export const _frontmatter = {};
      |              ^
  112 |

Guia do colaborador