# Kiln

**Kiln** is a documentation-site generator written in Swift. You describe your
site in a type-safe Swift configuration and Kiln turns a directory of markdown
into a fast, modern static website — no YAML, no Python toolchain.

It was built to replace MkDocs-based documentation sites (such as
[Vapor's](https://docs.vapor.codes)), so it covers the features those sites rely
on: multi-language docs with fallback, a themeable UI, client-side search,
admonitions, and more.

!!! tip "New here?"
    Head to [Installation](getting-started/installation.md) and the
    [Quick Start](getting-started/quick-start.md) to get a site running in a
    couple of minutes — or scaffold one instantly with [`kiln new`](getting-started/cli.md).

## Why Kiln?

- **Swift all the way down** — your whole site is a single, type-safe `KilnSite`
  value with a navigation result-builder DSL. Configuration mistakes are
  compile errors, not runtime surprises.
- **Localised** — first-class multi-language support with automatic fallback to
  your default language, per-language navigation and UI strings, hreflang
  alternates, and a language switcher.
- **Versioned** — ship multiple documentation versions with a built-in version
  switcher (try it in the top bar). The latest version lives at the root; older
  and pre-release versions get their own URLs and a banner.
- **Themeable** — ships with a fresh, responsive default theme (light/dark,
  sidebar nav, on-page table of contents). Override any part with your own
  [Leaf](https://github.com/vapor/leaf-kit) templates.
- **Searchable** — a client-side search index is generated per language. No
  external service, no build-time JavaScript toolchain.
- **SEO-ready** — canonical URLs, OpenGraph/Twitter cards, `sitemap.xml`,
  `robots.txt`, and a build-time [link checker](guides/link-checking.md).
- **AI-friendly** — generates [`llms.txt`](guides/llms.md) and a raw-markdown
  copy of every page for tools and agents.

## A quick taste

```swift
import Kiln

let site = KilnSite(name: "My Docs", url: "https://example.com") {
    Page("Welcome", "index.md")
    Section("Guides") {
        Page("Configuration", "guides/configuration.md")
    }
}

try await Kiln.build(site, contentDirectory: "Content", outputDirectory: "public")
```

| Feature                                         | Status      |
| ----------------------------------------------- | ----------- |
| Type-safe Swift configuration                   | ✅ Supported |
| Markdown + admonitions + front matter           | ✅ Supported |
| Localisation with fallback                      | ✅ Supported |
| Client-side search (Unicode/CJK aware)          | ✅ Supported |
| Theming via Leaf templates                      | ✅ Supported |
| SEO, social cards, sitemap, link checking       | ✅ Supported |
| `kiln` CLI (`new` / `build` / `serve`)          | ✅ Supported |
| Versioned documentation                         | ✅ Supported |

## This site is built with Kiln

Everything you're reading is generated by Kiln from the markdown in
[`Examples/ExampleSite`](https://github.com/brokenhandsio/kiln/tree/main/Examples/ExampleSite).
It doubles as the project's worked example — the best reference for how a real
site is wired together.
