src Directory
As an alternative to having the special Nextra content directory and
mdx-components file in the root of your project, Nextra also supports the
common pattern of placing application code under the src directory.
This separates application code from project configuration files which mostly live in the root of a project, which is preferred by some individuals and teams.
To use the src directory, move the content directory and mdx-components
file to src/content or src/mdx-components respectively.
- page.jsx
- layout.jsx
- index.mdx
- mdx-components.js
- next.config.js
- package.json
Without src directory
- page.jsx
- layout.jsx
- index.mdx
- mdx-components.js
- next.config.js
- package.json
With src directory
Last updated on