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:
lang
: Default documentation language. To accommodate most projects, we support both Chinese and English documents by default. The default language is en
. If the current documentation project does not require multilingual support, this can be set to null
or undefined
.title
: Documentation title, displayed on the browser tab.logo
: Logo at the top left of the documentation, supports image URLs or file paths. Absolute paths refer to files under the public
directory, relative paths refer to files relative to the current tool directory. By default, the built-in Alauda logo from the doom
package is used.logoText
: Documentation title, displayed next to the logo at the top left.icon
: Documentation favicon, defaults to the same as logo
.base
: Base path for the documentation, used when deploying to a non-root path, such as product-docs
. Defaults to /
.outDir
: Directory for build outputs, defaults to dist/{base}/{version}
. If specified, it changes to dist/{outDir}/{version}
, where version
is optional. See Multi-version Build for reference.Refer to API Documentation for writing documentation.
Refer to Permission Documentation for writing documentation.
frontmatterMode
ignore
: Ignore the frontmatter of the referenced document, keep using the current document's frontmatter.merge
: Merge the frontmatter of the referenced document. If keys conflict, 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.
Taking the above 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 after processing is used 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.
Unconfigured languages will trigger warnings in the command line and fall back to rendering as plaintext
.
sites.yaml
ConfigurationThe sites.yaml
configuration file is used to configure subsite information associated with the current documentation site. This information is used by External Site Components and when building single-version documentation.
Please use public/robots.txt
for Algolia crawler verification.
Due to the current architecture limitations of rspress
, using Algolia search requires implementing via a custom theme. To unify usage of related theme features, we provide the @alauda/doom/theme
theme entry. Please add the following theme configuration file to enable: