Config options
On this page
kilim.config.ts default-exports defineConfig({ ... }). Every option is optional. The config is checked when it loads: an unknown option or a wrong value stops the command with the option's name, e.g. kilim.config.ts: "timezone" must be an IANA time zone such as "Europe/Istanbul" or "UTC".
import { defineConfig } from "@kilim-dev/core";
export default defineConfig({
title: "My Blog",
url: "https://example.com",
description: "Notes on building fast sites.",
timezone: "Europe/Istanbul",
theme: "default",
});| Option | Default | Meaning |
|---|---|---|
title | none | Site title, site.title in layouts. |
url | none | Origin the site is published at, e.g. "https://example.com". |
description | none | Meta description of pages without their own description. |
titleTemplate | "%s | <title>" | Page <title> pattern; %s is the page title. |
timezone | "UTC" | IANA time zone for dates written without an offset. |
trailingSlash | true | /blog/post/ (true) or /blog/post written as post.html. |
url takes an http or https origin without a path. Canonical links, Open Graph tags, JSON-LD, sitemap.xml, feeds and Open Graph images need it; without it they are left out and the build warns.
titleTemplate must contain %s. Without one, pages are titled Page | Site title, or just Page when there is no title. A page whose title is the site title, such as a home page, keeps it as it is.
timezone is used for dates without an offset (date: 2026-11-01 is midnight there), for the :year, :month and :day of permalink patterns and for showing dates in the theme. trailingSlash is explained under URLs.
| Option | Default | Meaning |
|---|---|---|
collections | none | Collections by name; see Collections. |
markdown | see below | Code highlighting and heading ids. |
i18n | none | Languages; see Multiple languages. |
export default defineConfig({
markdown: {
// Code block languages left plain without a warning.
ignoreLanguages: ["mermaid"],
// Gives headings an id from their text or a trailing {#id}.
headingIds: true,
},
});markdown. option | Default | Meaning |
|---|---|---|
ignoreLanguages | [] | Languages that stay unhighlighted without a warning, any case. |
headingIds | true | Heading ids for #anchor links and "On this page" lists. |
| Option | Default | Meaning |
|---|---|---|
theme | none | A theme name such as "default" or "terminal", a package name, or a theme object. |
A name is the folder themesDir/<name>/ when it exists, else the package @kilim-dev/theme-<name>, kilim-theme-<name> or <name>. Without a theme, pages get a minimal HTML skeleton. The theme's settings are not in the config: they live in settings/<theme>.yaml (and settings/<theme>.<locale>.yaml per language), only the ones that differ from the theme's defaults, checked when the site builds. Kilim 0.1's themeSettings, i18n.themeSettings and theme-settings.yaml stop the build with where to move them. See Using a theme.
| Option | Default | Meaning |
|---|---|---|
minify | true | Minifies the HTML. |
images | true | Responsive AVIF and WebP versions of local images; false keeps the originals. |
fonts | see below | Subsets local web fonts to the characters the site uses. |
csp | true | Content-Security-Policy in _headers. |
speculationRules | true | Prefetches same-site links when the reader is about to click them. |
sitemap | true | Writes sitemap.xml (needs url). |
feed | true | Feeds next to collection list pages (needs url). |
ogImage | true | An Open Graph image per page from the theme's template (needs url). |
export default defineConfig({
images: {
widths: [640, 960, 1280, 1920],
formats: ["avif", "webp"],
sizes: "(min-width: 48rem) 48rem, 100vw",
quality: 75,
},
});images. option | Default | Meaning |
|---|---|---|
widths | [640, 960, 1280, 1920] | Widths to write; those above the original are skipped. |
formats | ["avif", "webp"] | Formats offered before the original. |
sizes | theme's, then "100vw" | sizes of images that have none. |
quality | 75 | Encoder quality from 1 to 100. |
lcp | true | Preloads the page's main image; see below. |
The main image is the first image in <main>; on a block page, only the first block is searched, since later blocks are usually below the first screen. It loads eagerly with fetchpriority="high" and a preload hint in <head>. An image that sets loading or another fetchpriority itself keeps it, and lcp: false leaves every image lazy.
fonts. option | Default | Meaning |
|---|---|---|
subset | true | Keeps only the characters of the pages and Basic Latin in local fonts. |
text | "" | Extra characters to keep, e.g. text that only a client script shows. |
The _headers file (read by hosts such as Cloudflare Pages and Netlify) gets a Content-Security-Policy. Scripts are limited to the site's own files and what the build added; styles, images, fonts, media and frames may come from any HTTPS site. Without plugins that add scripts, the policy is:
default-src 'self'; script-src 'self' 'inline-speculation-rules'; style-src 'self' 'unsafe-inline' https:; img-src 'self' data: https:; font-src 'self' data: https:; media-src 'self' https:; frame-src 'self' https:; connect-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self' https:; frame-ancestors 'self'An object replaces or adds directives, and an empty string removes one; false leaves the header out:
export default defineConfig({
csp: { "img-src": "'self'", "frame-ancestors": "'none'" },
});These three are shorthands for the built-in plugins of the same name. false turns one off; feed also takes the options of feed():
feed. option | Default | Meaning |
|---|---|---|
formats | ["rss"] | Any of "rss", "atom" and "json". |
limit | 20 | Newest entries per feed. |
Configure a built-in plugin either here or in plugins, not both. robots.txt is always written; it points at the sitemap when there is one.
| Option | Default | Meaning |
|---|---|---|
plugins | [] | Build plugins, e.g. [search()]; see Plugins. |
audit | none | Rule severities and options; see Audit rules. |
deploy | none | The adapter kilim deploy uses; see Deploy. |
import { defineConfig } from "@kilim-dev/core";
import { git } from "@kilim-dev/core/adapters";
import { search } from "@kilim-dev/core/plugins";
export default defineConfig({
plugins: [search()],
audit: { rules: { "meta/title-length": ["warn", { max: 70 }] } },
deploy: git({ branch: "gh-pages" }),
});Plugin names must be unique. The adapter's options are checked when the config loads, and an error names the line, e.g. kilim.config.ts:13: "deploy.branch": ....
Paths are relative to the project root.
| Option | Default | Holds |
|---|---|---|
contentDir | "content" | Markdown files. |
publicDir | "public" | Files copied to the output as they are. |
outDir | "dist" | The built site. |
stylesDir | "styles" | Site CSS: critical.css (inlined) and main.css. |
themesDir | "themes" | Local themes, <name>/index.tsx. |
layoutsDir | "layouts" | The site's own layouts and partials/. |
overridesDir | "overrides" | Replacements for theme layouts, partials, components, blocks. |
componentsDir | "components" | The site's own Markdown components. |
blocksDir | "blocks" | The site's own blocks. |
overridesDir must not overlap layoutsDir, componentsDir or blocksDir.