Skip to content
Discussion options

You must be logged in to vote

Hi!

Gatsby has the conventation that you can only place valid React components (that serve as pages) inside src/pages. An exception to this is gatsby-plugin-mdx which will allow you to place MDX files (and MD files if you edit the extensions option) inside src/pages.

So you have two options:
a) use gatsby-plugin-mdx
b) Use the File System Route API (https://www.gatsbyjs.com/docs/reference/routing/file-system-route-api/) to take your MD files and create pages this way.

Option b) would be something like:

src/pages/{MarkdownRemark.title}.js and then you'd get the content from your markdown files for that template.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@freshprinze
Comment options

Answer selected by freshprinze
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #30978 on April 21, 2021 12:32.