Configuration
TOC
Configuration FileBasic ConfigurationAPI Documentation ConfigurationPermission Documentation ConfigurationReference Documentation ConfigurationfrontmatterModeRelease Notes ConfigurationSidebar ConfigurationInternal Document Routes ConfigurationOnly Include Document Routes ConfigurationSyntax Highlighting Plugin Configurationsites.yaml ConfigurationTranslation ConfigurationEditing Documentation in Code RepositoryDocumentation Export ConfigurationDocumentation Lint ConfigurationAlgolia Search ConfigurationSitemap ConfigurationConfiguration File
In most cases, we only need to use a static yaml configuration file, supporting doom.config.yaml or doom.config.yml. For complex scenarios, such as requiring dynamic configuration or custom rspress plugins, js/ts configuration files can be used, supporting multiple file formats including .js/.ts/.mjs/.mts/.cjs/.cts.
For js/ts configuration files, we need to export the configuration, which can be combined with the defineConfig function exported from @alauda/doom/config to provide type assistance:
Basic Configuration
lang: Default document language. To accommodate most projects, we support both Chinese and English documents by default. The default language isen. If the current documentation project does not require multilingual support, this can be set tonullorundefined.title: Document title, displayed on the browser tab.logo: Logo at the top left of the document, supports image URLs or file paths. Absolute paths refer to files under thepublicdirectory, relative paths refer to files relative to the current tool directory. Defaults to the Alauda logo built into thedoompackage.logoText: Document title, displayed at the logo position in the top left.icon: Document favicon, defaults to the same aslogo.base: Base path of the document, used when deploying to a non-root path, e.g.,product-docs. Defaults to/.outDir: Build output directory, defaults todist/{base}/{version}. If specified, it changes todist/{outDir}/{version}, whereversionis optional. Refer to Multi-version Build.
API Documentation Configuration
Refer to API Documentation for writing documentation.
Permission Documentation Configuration
Refer to Permission Documentation for writing documentation.
Reference Documentation Configuration
frontmatterMode
ignore: Ignore the frontmatter of the referenced document, keep the frontmatter of the current document.merge: Merge the frontmatter of the referenced document. If keys overlap, the referenced document's values override the current document's.replace: Replace the current document's frontmatter with that of the referenced document.remove: Remove the current document's frontmatter.
Refer to Reference Documentation for writing documentation.
Release Notes Configuration
Taking template=fixed&project=DevOps as an example, fixed is the template name defined in queryTemplates. The remaining query parameter project=DevOps is passed as ejs template parameters to the fixed template, which is then processed to form a jira jql request to https://jira.alauda.cn/rest/api/2/search?jql=<jql>. This API requires authentication, and the environment variables JIRA_USERNAME and JIRA_PASSWORD must be provided to preview the effect.
Sidebar Configuration
Internal Document Routes Configuration
Only Include Document Routes Configuration
Syntax Highlighting Plugin Configuration
Unconfigured languages will trigger warnings in the command line and fall back to plaintext rendering.
sites.yaml Configuration
The sites.yaml configuration file is used to configure subsite information associated with the current documentation site. It is used by External Site Components and when building single-version documentation.
Translation Configuration
Editing Documentation in Code Repository
Documentation Export Configuration
Documentation Lint Configuration
Algolia Search Configuration
Please use public/robots.txt for Algolia crawler verification.
Due to current architectural limitations of rspress, Algolia search functionality must be implemented via custom themes. To unify the use of related theme features, we provide the @alauda/doom/theme theme entry. Please add the following theme configuration file to enable it: