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",
});

Site

OptionDefaultMeaning
titlenoneSite title, site.title in layouts.
urlnoneOrigin the site is published at, e.g. "https://example.com".
descriptionnoneMeta 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.
trailingSlashtrue/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.

Content and Markdown

OptionDefaultMeaning
collectionsnoneCollections by name; see Collections.
markdownsee belowCode highlighting and heading ids.
i18nnoneLanguages; 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. optionDefaultMeaning
ignoreLanguages[]Languages that stay unhighlighted without a warning, any case.
headingIdstrueHeading ids for #anchor links and "On this page" lists.

Theme

OptionDefaultMeaning
themenoneA 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.

Output

OptionDefaultMeaning
minifytrueMinifies the HTML.
imagestrueResponsive AVIF and WebP versions of local images; false keeps the originals.
fontssee belowSubsets local web fonts to the characters the site uses.
csptrueContent-Security-Policy in _headers.
speculationRulestruePrefetches same-site links when the reader is about to click them.
sitemaptrueWrites sitemap.xml (needs url).
feedtrueFeeds next to collection list pages (needs url).
ogImagetrueAn Open Graph image per page from the theme's template (needs url).

images

export default defineConfig({
  images: {
    widths: [640, 960, 1280, 1920],
    formats: ["avif", "webp"],
    sizes: "(min-width: 48rem) 48rem, 100vw",
    quality: 75,
  },
});
images. optionDefaultMeaning
widths[640, 960, 1280, 1920]Widths to write; those above the original are skipped.
formats["avif", "webp"]Formats offered before the original.
sizestheme's, then "100vw"sizes of images that have none.
quality75Encoder quality from 1 to 100.
lcptruePreloads 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

fonts. optionDefaultMeaning
subsettrueKeeps 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.

csp

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'" },
});

feed, sitemap and ogImage

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. optionDefaultMeaning
formats["rss"]Any of "rss", "atom" and "json".
limit20Newest 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.

Plugins, checks and deploy

OptionDefaultMeaning
plugins[]Build plugins, e.g. [search()]; see Plugins.
auditnoneRule severities and options; see Audit rules.
deploynoneThe 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": ....

Folders

Paths are relative to the project root.

OptionDefaultHolds
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.