1 min readMay 15, 2026by maintainer

Rendering Model

The document page route is src/app/(public)/docs/[...slug]/page.tsx. It turns a URL into a fully rendered documentation page.

Request flow

  1. The route receives the slug from /docs/[...slug].
  2. getDocBySlug() finds the matching .md or .mdx file.
  3. gray-matter splits frontmatter from the Markdown body.
  4. validateFrontmatter() validates the metadata schema.
  5. The current session is loaded.
  6. checkAccess() decides whether the viewer can read the page.
  7. getAllDocs() and buildNavTree() create the viewer-specific menu.
  8. getScopedNav() narrows the sidebar to the current section.
  9. MdxRenderer renders the Markdown and MDX body.
  10. Page controls render around the body: metadata, breadcrumbs, table of contents, feedback, report issue, previous/next, progress bar, and scroll-to-top.

Markdown renderer

MdxRenderer uses:

  • next-mdx-remote/rsc for server-side MDX rendering
  • remark-gfm for GitHub-flavored Markdown tables, task lists, and strikethrough
  • rehype-slug for heading IDs
  • rehype-autolink-headings for clickable heading anchors
  • preprocessAdmonitions() for MkDocs and Docusaurus-style callouts
  • Custom components such as Admonition, CodeTabs, Collapsible, Protected, ExtensionGrid, and VideoEmbed

Page chrome

The app renders more than the Markdown body:

AreaSource
Browser metadataFrontmatter plus breadcrumb titles
SidebarbuildNavTree() and getScopedNav()
BreadcrumbsCurrent slug segments
Video blockvideo frontmatter field
Deprecation bannerstatus: deprecated
Table of contentsRendered headings in the page
Feedback and issue linksAuthenticated client-tier users and above
Previous and next linksCurrent scoped sidebar order
Rendering is access-aware

The same document can render as full content, a locked access page, or a 404 depending on the viewer and the page's access tier.

Rendering a section grid

This page is part of the rendering section. The grid below is rendered by the same MDX component available to your own docs:

Rendering Model | Nexus Docs