Skip to main content

Config Reference

Doom extends Rspress configuration with additional options for documentation sites. Configuration can be provided in YAML, JSON, or JavaScript formats.

Configuration Files

Doom searches for configuration in this order:
  1. doom.config.yaml / doom.config.yml
  2. doom.config.js / doom.config.ts
  3. doom.config.mjs / doom.config.mts
  4. doom.config.cjs / doom.config.cts

Basic Configuration

# doom.config.yaml
title: My Documentation
lang: en
root: docs
outDir: dist

themeConfig:
  sidebar:
    /:
      - text: Getting Started
        link: /getting-started

Core Options

title

title
string
required
Site title displayed in navigation and browser tab
title: Doom Documentation

lang

lang
string
default:"en"
Default language of the documentation
lang: en

root

root
string
default:"docs"
Root directory containing documentation files
root: docs

outDir

outDir
string
default:"dist"
Output directory for built files
outDir: build

base

base
string
default:"/"
Base URL path for the site
base: /docs/

prefix

prefix
string
Prefix for the documentation base path
prefix: /v2

Doom-Specific Options

sites

sites
DoomSite[]
Multiple documentation sites configuration
sites:
  - name: v1
    version: 1.0
    base: /v1/
  - name: v2
    version: 2.0
    base: /v2/

reference

reference
ReferenceItem[]
External documentation references to import
reference:
  - repo: kubernetes/website
    branch: main
    path: content/en/docs
    target: k8s-docs
sidebar
AutoSidebarPluginOptions
Auto-sidebar generation options
sidebar:
  collapsed: true
  collapsible: true

api

api
ApiPluginOptions
API documentation plugin configuration
api:
  openapi: ./openapi.yaml
  outputDir: api

permission

permission
PermissionPluginOptions
Permission management configuration
permission:
  roles:
    - admin
    - editor
    - viewer

translate

translate
TranslateOptions
Translation configuration
translate:
  systemPrompt: |
    Translate technical documentation professionally
  userPrompt: |
    Maintain consistent terminology

lint

lint
LintOptions
Linting configuration
lint:
  cspellOptions:
    words:
      - Kubernetes
      - Rspress
    ignoreWords:
      - kubectl

algolia

algolia
AlgoliaOptions
Algolia search configuration
algolia:
  appId: YOUR_APP_ID
  apiKey: YOUR_API_KEY
  indexName: docs

siteUrl

siteUrl
string
Full site URL for sitemap generation
siteUrl: https://docs.example.com

editRepoBaseUrl

editRepoBaseUrl
string
Base URL for “Edit this page” links
editRepoBaseUrl: https://github.com/user/repo/blob/main

export

export
ExportItem[]
PDF export scope configuration
export:
  - name: user-guide
    scope:
      - guides/**
      - tutorials/**
  - name: api-reference
    scope:
      - apis/**

onlyIncludeRoutes

onlyIncludeRoutes
string[]
Glob patterns of routes to include (whitelist)
onlyIncludeRoutes:
  - guides/**
  - api/**

internalRoutes

internalRoutes
string[]
Glob patterns of internal/draft routes to exclude
internalRoutes:
  - drafts/**
  - internal/**
  - wip/**

releaseNotes

releaseNotes
ReleaseNotesOptions
Release notes configuration
releaseNotes:
  enabled: true
  path: /release-notes

Theme Configuration

themeConfig.sidebar

themeConfig.sidebar
object
Sidebar navigation structure
themeConfig:
  sidebar:
    /:
      - text: Getting Started
        items:
          - text: Installation
            link: /installation
          - text: Quick Start
            link: /quickstart
      - text: Guides
        items:
          - text: Basics
            link: /guides/basics

themeConfig.locales

themeConfig.locales
LocaleConfig[]
Multi-language configuration
themeConfig:
  locales:
    - lang: en
      label: English
      sidebar:
        /:
          - text: Guide
            link: /guide
    - lang: zh
      label: 中文
      sidebar:
        /zh:
          - text: 指南
            link: /zh/guide

Type Definitions

DoomSite

interface DoomSite {
  name: string
  version: string | number
  base: string
}

ExportItem

interface ExportItem {
  name?: string
  scope: string | string[]
  flattenScope?: string[]
  onlyInclude?: string[]
  exclude?: string[]
}

TranslateOptions

interface TranslateOptions {
  systemPrompt?: string
  userPrompt?: string
}

LintOptions

interface LintOptions {
  cspellOptions?: Partial<Options>
}

AlgoliaOptions

interface AlgoliaOptions {
  appId: string
  apiKey: string
  indexName: string
}

Complete Example

# doom.config.yaml
title: Acme Documentation
lang: en
root: docs
outDir: dist
base: /docs/
prefix: /v2
siteUrl: https://docs.acme.com

themeConfig:
  locales:
    - lang: en
      label: English
      sidebar:
        /:
          - text: Getting Started
            items:
              - text: Installation
                link: /installation
              - text: Quick Start
                link: /quickstart
          - text: Guides
            items:
              - text: Basics
                link: /guides/basics
              - text: Advanced
                link: /guides/advanced
    
    - lang: zh
      label: 中文
      sidebar:
        /zh:
          - text: 开始使用
            items:
              - text: 安装
                link: /zh/installation
              - text: 快速开始
                link: /zh/quickstart

editRepoBaseUrl: https://github.com/acme/docs/blob/main

algolia:
  appId: ABC123
  apiKey: xyz789
  indexName: acme-docs

translate:
  systemPrompt: |
    Translate technical documentation for Acme product.
    Maintain professional tone.

lint:
  cspellOptions:
    words:
      - Acme
      - Kubernetes
      - microservices

export:
  - name: user-guide
    scope:
      - getting-started/**
      - guides/**
  - name: api-reference
    scope:
      - apis/**

internalRoutes:
  - drafts/**
  - internal/**

reference:
  - repo: acme/shared-docs
    branch: main
    path: content
    target: shared

Build docs developers (and LLMs) love