Skip to main content
Docus is built as a Nuxt layer, allowing it to seamlessly extend Nuxt applications while providing full access to the Nuxt ecosystem.

Nuxt Layer Architecture

Docus uses Nuxt’s layer feature to provide a complete documentation framework that can be extended:
[nuxt.config.ts]

How Layers Work

1

Layer Extension

Docus is extended using the extends property, inheriting all components, composables, and configuration
2

Override Priority

Your local files automatically override Docus layer files with the same name
3

Configuration Merging

Configurations are deep-merged, allowing you to customize any aspect
Nuxt layers enable Docus to be fully extensible while maintaining a clean separation between framework and user code.

Included Modules

Docus includes and configures several essential Nuxt modules:
[layer/nuxt.config.ts]

Core Modules

Provides the component library and design system used throughout Docus.
Nuxt UI Documentation
Powers the Markdown and MDC content system with collections and queries.
Nuxt Content Documentation
Optimizes images with automatic resizing and format conversion.
Nuxt Image Documentation
Generates robots.txt for SEO.
Provides Model Context Protocol server for AI integration.
Generates Open Graph images for social media.
Generates llms.txt files for AI consumption.

Custom Docus Modules

Docus includes four internal modules that provide core functionality:

Config Module

Automatically configures site metadata, SEO, and i18n:
[layer/modules/config.ts]
function
Automatically detects site URL from environment variables or hosting platform
function
Extracts name and description from package.json
function
Reads Git repository information for GitHub integration

Routing Module

Manages route generation and i18n routing:
[layer/modules/routing.ts]

Markdown Rewrite Module

Configures Vercel rewrites for AI agents to access raw Markdown:
[layer/modules/markdown-rewrite.ts]
The markdown-rewrite module only activates on Vercel deployments. It’s skipped in development and other hosting platforms.

CSS Module

Manages CSS processing and custom icon collections:
[layer/modules/css.ts]

Nuxt Content Integration

Docus deeply integrates with Nuxt Content:

Content Collections

Automatic collection setup based on structure:
[layer/content.config.ts]

MDC Configuration

[layer/nuxt.config.ts]
Docus uses Shiki with JavaScript engine for fast, accurate code highlighting in multiple languages.

Nitro & Prerendering

Docus configures Nitro for optimal static site generation:
[layer/nuxt.config.ts]
Automatically discovers and prerenders all linked pages
boolean
default:"false"
Continues prerendering even if individual pages fail

Vite Configuration

Docus extends Vite configuration for optimal bundling:
[layer/nuxt.config.ts]

Adding Modules

Extend Docus with additional Nuxt modules:
[nuxt.config.ts]
1

Install Module

2

Add to Config

Add the module to the modules array
3

Configure

Add module-specific configuration

Compatibility

Docus is compatible with:

Nuxt 3

Full support for Nuxt 3.x

Node.js 18+

Requires Node.js 18 or higher

TypeScript

Full TypeScript support with types

Edge Functions

Works with Vercel Edge, Netlify Edge, Cloudflare Workers

Compatibility Date

[layer/nuxt.config.ts]
Docus uses modern Nuxt features including async context for improved performance and developer experience.

Next Steps

Nuxt Docs

Learn about Nuxt features

Customization

Extend Docus functionality