---
title: Configuration reference
description: 'Look up every root and vault setting, its default, and how it merges.'
---

# Configuration reference

Export the result of `defineConfig()` from `@svartz/config`. The CLI looks for `svartz.config.ts`, `svartz.config.mjs`, `svartz.config.js`, `.svartzrc.ts`, `.svartzrc.mjs`, or `.svartzrc.js`. Use ESM for `.js` (the nearest `package.json` has `"type": "module"`). Use `--config <path>` or `SVARTZ_CONFIG` to select a file or directory. Relative vault, output, favicon, and local theme paths resolve from the config file's directory.

## Root

| Key | Type and default |
| --- | --- |
| `version` | Required config-format SemVer string with major `1`. Keep the value generated by init. |
| `$schema` | Optional schema URL string. |
| `vaults` | Required array of vaults. Each needs a unique string `id`, a folder `path`, and a `target`. |
| `defaults` | Optional object of the vault options below. It does not set `id`, `path`, or `target`. |
| `build.concurrency` | Number, default 10. |
| `build.maxRetries` | Number, default 3. |
| `passwordGroups` | Map of group names to `{ env: string }`; group names use letters, digits, `_`, or `-`. The values live in the build environment. See [Encrypted notes](https://svartz.dev/writing/encrypted-notes.md). |

## Vault options

| Key | Type and default |
| --- | --- |
| `mountPath` | Static URL path, default site root. Host mounts cannot overlap. |
| `publicationMode` | `"exclusion"` (default) or `"inclusion"`. |
| `include` | List of glob strings; default empty. A vault list replaces the default list. |
| `exclude` | List of glob strings. Combines `.trash/**`, `**/.trash/**`, the defaults, and this vault's list. |
| `linkResolution` | `"closest"` (default), `"shallowest"`, or `"absolute"`. |
| `theme` | Package name, local module path, or an object with `base` plus options. Default `"@svartz/theme-minimal"`. |
| `frontmatter` | Object of field names; see below. |
| `site` | Public site details; see below. |
| `discovery` | Feed, sitemap, social images, Markdown, favicon, and date source options; see below. |
| `index.markdown` | Boolean, default `false`. Include each public note's portable Markdown body as `entry.markdown` in the published index. |
| `analytics` | Provider settings; default off. A vault setting replaces the default object. See [Analytics](https://svartz.dev/plugins/analytics.md). |
| `plugins` | List of plugin objects; default empty. Merge by ID. Add `{ id, disabled: true }` to remove a matching plugin. |
| `outDir` | Output path string, default `.svartz/vaults/<id>/dist`. Separate vault outputs cannot overlap. |

A vault's scalar settings take precedence over `defaults`. Svartz shallow-merges `theme`, `frontmatter`, and `site` and merges the individual discovery properties. See [Publication](https://svartz.dev/writing/publication.md) and [Links and routes](https://svartz.dev/writing/links-and-routes.md) for how the filters and link strategies behave.

## Targets

| `target.type` | Other fields |
| --- | --- |
| `static` | `basePath?: string`; default root. |
| `node` | `basePath?: string`; default root. |
| `cloudflare-workers` | [Wrangler fields](https://svartz.dev/reference/wrangler.md) inline; build owns the entry and asset directory. |
| `cloudflare-pages` | `projectName?: string`. Name an existing Pages project when deploying. |
| `host` | None. Use the app's adapter and deployment base. |

See [Deploy a vault](https://svartz.dev/start/deploying.md) for output locations and commands.

## Theme

The shorthand `theme: "@svartz/theme-wiki"` sets `base`. In object form, `base` is a string or a nonempty list of strings, with the first selecting the composed site's frame and styles. Other settings pass through to the selected theme. See [Themes](https://svartz.dev/themes.md) for their options and [composition](https://svartz.dev/themes/choosing-and-composing.md) for renderer routing.

The schema also accepts `recentNotes` (`enabled?: boolean`, `limit?: positive integer`, `showTags?: boolean`, `linkToMore?: string`) and record-shaped Tailwind [scale keys](https://github.com/mia-cx/svartz/blob/main/packages/core/src/tailwind/schema.ts) such as `colors` and `fontFamily` for custom themes that read them. First-party themes style through `tokens` and do not read `recentNotes` or Tailwind scale keys.

`theme.comments` enables the Giscus integration. Supply strings `repo`, `repoId`, `category`, and `categoryId` from [Giscus](https://giscus.app/). The repository needs GitHub Discussions and the Giscus app.

| Optional key | Type | Default |
| --- | --- | --- |
| `enabled` | Boolean | `true` |
| `mapping` | `"url"`, `"title"`, `"og:title"`, `"specific"`, `"number"`, or `"pathname"` | `"pathname"` |
| `term` | Nonempty string, required for `"specific"` or `"number"` | Unset |
| `strict` | Boolean | `false` |
| `reactionsEnabled` | Boolean | `true` |
| `inputPosition` | `"top"` or `"bottom"` | `"bottom"` |
| `lang` | String | `"en"` |
| `lightTheme`, `darkTheme` | Strings | `"light"`, `"dark"` |

Use [frontmatter](https://svartz.dev/writing/frontmatter.md) to control comments on a note.

## Frontmatter field names

| Key | Default |
| --- | --- |
| `titleField` | `title` |
| `descriptionField` | `description` |
| `tagsField` | `tags` |
| `aliasesField` | `aliases` |
| `createdAtField` | `created_at` |
| `updatedAtField` | `updated_at` |
| `publishedField` | `published_at` |
| `dateFormat` | Unset. Optional Moment format for parsing frontmatter dates. If a value does not match, Svartz tries ordinary date parsing. |

## Site metadata

| Key | Value and default |
| --- | --- |
| `title` | String; defaults to the vault ID. |
| `description`, `author` | Strings; unset. |
| `url` | Absolute HTTP(S) URL without credentials, query, or fragment; unset. Include the deployment base, not the mount. |
| `image` | String for the default social image; unset. |
| `favicon` | Local path string; unset. The theme can provide a fallback. |

## Discovery

| Key | Type and default |
| --- | --- |
| `feed.enabled` | Boolean; on when `site.url` exists. |
| `feed.limit` | Positive integer; 10. |
| `feed.content` | `"summary"` (default) or `"full"`. |
| `feed.sort` | `"published"` (default) or `"modified"`. |
| `sitemap.enabled` | Boolean; on when `site.url` exists. |
| `socialImages.enabled` | Boolean; on when `site.url` exists. |
| `llms.enabled` | Boolean; on. Controls `llms.txt` and published Markdown copies. |
| `favicon.enabled` | Boolean; on for standalone targets, off for hosts. |
| `dateSources` | Nonempty list drawn from `"frontmatter"`, `"git"`, and `"filesystem"`, default in that order. |

See [Feeds, sitemaps, and llms.txt](https://svartz.dev/writing/discovery.md) for what each output includes.

API reference: [defineConfig](https://svartz.dev/reference/api/config/defineconfig.md), [SvartzConfig](https://svartz.dev/reference/api/config/svartzconfig.md), [VaultConfig](https://svartz.dev/reference/api/config/vaultconfig.md), and the rest of [@svartz/config](https://svartz.dev/reference/api/config.md).
