Skip to content

Commit

Permalink
Add info on making Next.js pick up .mdx pages (#1250)
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-overton committed Sep 17, 2020
1 parent 0c0ecc2 commit ae05663
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/getting-started/next.mdx
Expand Up @@ -15,6 +15,20 @@ const withMDX = require('@next/mdx')()
module.exports = withMDX()
```

### Treat `.mdx` files as pages

To have Next.js treat `.mdx` files in the pages directory as pages use the `pageExtensions` property:

```js
// next.config.js
const withMDX = require('@next/mdx')({
extension: /\.mdx?$/,
})
module.exports = withMDX({
pageExtensions: ['js', 'jsx', 'mdx'],
})
```

### Use MDX for `.md` files

The Next.js MDX plugin allows for you to also use MDX parsing for `.md` files:
Expand Down

1 comment on commit ae05663

@vercel
Copy link

@vercel vercel bot commented on ae05663 Sep 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.