zslabs / gatsby-plugin-mdx-frontmatter

Utility to parse Markdown frontmatter with MDX in Gatsby
MIT License
12 stars 2 forks source link

How can I use this with pages? #1

Open muuvmuuv opened 4 years ago

muuvmuuv commented 4 years ago

I am happy someone else also had this problem. For blog posts with gatsby-source-filesystem this is working great but not for mdx pages inside src/pages.

With the graphiql GUI I can see the parsed MDX frontmatter but somehow it is not passed to pageCOntext in my default template.

muuvmuuv commented 4 years ago

This returns the correct mdx in graphiql query when doing allSitePages:

  createTypes(`
    type SitePageContext implements Node {
      frontmatter: MdxFrontmatter
    }

    type MdxFrontmatter {
      title: String @mdx
    }
  `)

but still not in my default template :D