Nextra projects follow a set of well-defined file conventions that control how content is discovered, how navigation is structured, and how MDX elements are rendered. Understanding these conventions is the foundation for working effectively with any Nextra-powered site.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/shuding/nextra/llms.txt
Use this file to discover all available pages before exploring further.
Conventions at a Glance
The four primary conventions you’ll encounter in every Nextra project are:| Convention | Purpose |
|---|---|
content/ directory | The default location for your .md and .mdx content files |
page.mdx / page.md | Next.js App Router pages that Nextra processes directly |
_meta.js files | Configure sidebar order, titles, separators, and navigation menus |
mdx-components file | Override how standard Markdown elements (headings, links, images) are rendered |
src/ directory if you prefer to keep application code separate from project configuration files.
Content Files
content/ Directory
Store all your
.md and .mdx files in the content/ directory. Nextra auto-discovers them and maps them to URL routes without needing the page filename convention.page.mdx File
Use Next.js App Router’s
page.mdx or page.md files when you need fine-grained control over routing or want to co-locate MDX content with other app directory files.Navigation & Styling
_meta.js File
Control sidebar order, page titles, external links, separators, and dropdown menus. Every directory can have its own
_meta.js file.mdx-components File
Export a
useMDXComponents function to override how heading tags, anchors, images, and other HTML elements are rendered across all MDX pages.Using a src/ Directory
Nextra supports the common convention of placing all application code — including the content/ directory and the mdx-components file — under a top-level src/ folder. This separates source code from project configuration files (such as next.config.mjs and package.json) that live at the project root.
Combining Approaches
You can mix thecontent/ directory approach with the app/ directory approach in the same project. Nextra collects .md and .mdx files from content/ and gathers page.md / page.mdx files from the app/ directory to build a unified pageMap used for navigation.
Routes defined in the
app/ directory take precedence over same-named routes in content/. Plan your directory structure accordingly to avoid conflicts.