Configuration Reference
This page enumerates the primary configuration sections and fields supported by DocBuilder for both direct build and daemon modes.
Top-Level Structure
Repositories
| Field | Type | Required | Description |
|---|---|---|---|
| url | string | yes | Git clone URL. |
| name | string | yes | Unique repository name (used in content paths). |
| branch | string | no | Branch to checkout (default per remote). |
| paths | []string | no | Documentation root paths (default: [“docs”]). |
| auth.type | enum | no | Authentication mode: token, ssh, or basic. |
| auth.token | string | conditional | Required when type=token. |
| auth.username | string | conditional | Required when type=basic. |
| auth.password | string | conditional | Required when type=basic. |
| auth.key_path | string | conditional | SSH private key path when type=ssh. |
Build Section
| Field | Type | Default | Description |
|---|---|---|---|
| clone_concurrency | int | 4 | Parallel clone/update workers (bounded to repo count). |
| clone_strategy | enum | fresh | Repository acquisition mode: fresh, update, or auto. |
| shallow_depth | int | 0 | If >0 use shallow clones of that depth. |
| prune_non_doc_paths | bool | false | Remove non-doc top-level directories after clone. |
| prune_allow | []string | [] | Keep-listed directories/files (glob). |
| prune_deny | []string | [] | Force-remove directories/files (glob) except .git. |
| hard_reset_on_diverge | bool | false | Force align local branch to remote on divergence. |
| clean_untracked | bool | false | Remove untracked files after successful update. |
| max_retries | int | 2 | Retry attempts for transient clone/update failures. |
| retry_backoff | enum | linear | Backoff strategy: fixed, linear, or exponential. |
| retry_initial_delay | duration | 1s | First retry delay. |
| retry_max_delay | duration | 30s | Maximum backoff delay cap. |
| workspace_dir | string | derived | Explicit workspace override path. |
| namespace_forges | enum | auto | Forge prefixing: auto, always, or never. |
| skip_if_unchanged | bool | daemon:true, CLI:false | Skip builds when nothing changed (daemon only). |
Daemon Section
Configuration for daemon mode operation, including link verification, sync scheduling, and storage paths.
Link Verification
Automated link validation using NATS for caching and event publishing. Requires NATS server with JetStream enabled.
| Field | Type | Default | Description |
|---|---|---|---|
| enabled | bool | true | Enable automatic link verification after builds. |
| nats_url | string | nats://localhost:4222 | NATS server connection URL (supports clustering). |
| subject | string | docbuilder.links.broken | NATS subject for publishing broken link events. |
| kv_bucket | string | docbuilder-link-cache | KV bucket name for caching link verification results. |
| cache_ttl | duration | 24h | TTL for successful link checks in cache. |
| cache_ttl_failures | duration | 1h | TTL for failed link checks in cache. |
| max_concurrent | int | 10 | Maximum concurrent link verification requests. |
| request_timeout | duration | 10s | HTTP timeout for link verification requests. |
| rate_limit_delay | duration | 100ms | Delay between link verification requests. |
| verify_external_only | bool | false | Verify only external links (skip internal links). |
| skip_edit_links | bool | true | Skip edit links that require authentication. |
| follow_redirects | bool | true | Follow HTTP redirects during verification. |
| max_redirects | int | 3 | Maximum number of redirects to follow. |
Link Verification Examples
Basic Configuration:
Remote NATS with Authentication:
NATS Cluster Configuration:
TLS/Secure Connection:
Custom Verification Settings:
Include Edit Links in Verification:
Disable Link Verification:
NATS Requirements
Link verification requires NATS with JetStream enabled:
Sync Configuration
| Field | Type | Default | Description |
|---|---|---|---|
| schedule | string | */5 * * * * | Cron expression for periodic repository sync. |
Storage Configuration
| Field | Type | Default | Description |
|---|---|---|---|
| output_dir | string | ./site | Output directory (must match output.directory). |
| repo_cache_dir | string | - | Persistent repository cache directory. |
Daemon Configuration Example
Versioning Section
Enables multi-version documentation by discovering and building multiple branches/tags from each repository.
| Field | Type | Default | Description |
|---|---|---|---|
| enabled | bool | false | Enable multi-version documentation. |
| strategy | enum | branches_and_tags | Version selection: branches_and_tags, branches_only, or tags_only. |
| default_branch_only | bool | false | Build only the default branch (overrides strategy). |
| branch_patterns | []string | ["*"] | Branch name patterns to include (glob). |
| tag_patterns | []string | ["*"] | Tag name patterns to include (glob). |
| max_versions_per_repo | int | 10 | Maximum versions to build per repository. |
Versioning Examples
With versioning enabled, DocBuilder:
- Discovers available branches/tags from each repository
- Expands each repository into multiple versioned builds
- Clones each version separately (branches use
refs/heads/, tags userefs/tags/) - Organizes content under repository-version paths
- Generates Hugo configuration with version metadata for version switchers
Hugo Section
| Field | Type | Description |
|---|---|---|
| title | string | Site title. |
| description | string | Site description. |
| base_url | string | Hugo BaseURL. |
| params | map[string]any | Relearn theme parameters (optional). |
| taxonomies | map[string]string | Custom taxonomy definitions (optional). |
Note: Theme selection has been removed. DocBuilder uses the Relearn theme exclusively.
Relearn Theme Parameters
Customize Relearn theme behavior via hugo.params:
See Use Relearn Theme for complete parameter reference.
Taxonomies
Hugo taxonomies allow you to classify and organize content. DocBuilder automatically configures the default Hugo taxonomies (tags and categories) but you can customize or extend them.
Default Configuration:
Custom Taxonomies:
The taxonomy key (e.g., tag, author) is the singular form used in Hugo’s templates and URLs, while the value (e.g., tags, authors) is the plural form used for the collection.
Usage in Frontmatter:
Once configured, you can use taxonomies in your markdown frontmatter:
DocBuilder’s FrontMatter model supports tags, categories, and keywords fields by default. Custom taxonomies can be added through the Custom field or by extending the FrontMatter structure.
Output Section
| Field | Type | Default | Description |
|---|---|---|---|
| directory | string | ./site | Output root. |
| clean | bool | true | Remove directory before build. |
Output Directory Unification
- DocBuilder treats
output.directoryas the canonical output root for both direct builds and daemon mode. - In daemon mode,
daemon.storage.output_dirmust matchoutput.directory. If not provided, it is derived fromoutput.directory. - A validation check enforces this equality (after path normalization). Mismatches cause configuration loading to fail.
- Recommendation: set only
output.directory; avoid settingdaemon.storage.output_dirunless absolutely necessary.
Build Report Fields (Selected)
| Field | Purpose |
|---|---|
| cloned_repositories | Successful clones/updates |
| failed_repositories | Failed clone/auth attempts |
| rendered_pages | Markdown pages written |
| static_rendered | Hugo run succeeded |
| doc_files_hash | Fingerprint of docs set |
| issues[] | Structured issue list |
Environment Variable Expansion
Values like ${GIT_ACCESS_TOKEN} in YAML are expanded using the current process environment. .env and .env.local files are loaded automatically (last one wins on conflicts).
Health and Readiness Endpoints
- Endpoints are exposed on both the docs port and the admin port.
GET /health: basic liveness endpoint; returns 200 when the server is responsive.GET /ready: readiness endpoint tied to render state.- Returns 200 only when
<output.directory>/publicexists. - Returns 503 before the first successful render or if the public folder is missing.
- Returns 200 only when
- When serving on the docs port, if the site is not yet rendered and the request path is
/, DocBuilder returns a short 503 HTML placeholder indicating that the documentation is being prepared. This switches automatically to the rendered site once available.
Kubernetes Probes
- Probe either the docs port or the admin port. Use
/readyfor readiness and/healthfor liveness. - Prefer probing
/readyinstead of the docs root/, since the root may return a temporary 503 placeholder before the first render.
Example: probe the docs port (8080)
Example: probe the admin port (8082)
Namespacing Behavior
When namespace_forges=auto and more than one distinct forge is present across repositories, content paths are written under content/<forge>/<repo>/.... Otherwise they remain content/<repo>/....
Skip Evaluation (Daemon Mode)
When running in daemon mode, builds are automatically skipped when nothing has changed:
- State Tracking: Repository commits, config hash, and doc file hashes are saved after each successful build
- Skip Rules: Validates version, config, repository commits, and content integrity
- Automatic: Enabled by default in daemon mode (
skip_if_unchanged: true) - CLI Mode: Not used - CLI builds always run when explicitly requested
This prevents unnecessary rebuilds when daemon polls/watches for changes but repositories haven’t been updated.
For CLI mode, simply don’t run docbuilder build if you don’t want a build. No caching is needed.
Recommendations
- Use
clone_strategy: autofor most CI and daemon scenarios. - Pin commit or module versions externally until v1.0.0 stability.
- Compare successive
doc_files_hashvalues to drive conditional downstream jobs.