@kiln-ssg/kiln

中文文档
0.5.2发布于 2026/11/01MIT零依赖构建来源已验证

kiln static site generator

原始使用文档
文档目录14 节
  1. Highlights
  2. Documentation
  3. Installation
  4. Via npm
  5. Prebuilt binary
  6. From source
  7. Via Nix
  8. First Site
  9. Usage
  10. Search
  11. Building from Source
  12. AVIF placeholders
  13. Reproducible dev shell (Nix)
  14. License

kiln

CI codecov License: MIT WakaTime coding time for kiln

A static site generator written in Rust for hakula.xyz, with CJK-friendly Markdown authoring and customizable themes.

Highlights

  • CJK-friendly Markdown for technical writing, with math, diagrams and syntax highlighting
  • Custom content components through nested ::: directives and theme templates
  • Page bundles that keep writing, images and page-specific styles together
  • Full-text search via Pagefind, with archives and feeds for finding and following posts
  • IgnIt theme with responsive layouts and dark mode, customizable through site overrides
  • Local preview with live reload, plus optimized stylesheets and image loading placeholders for publication

Documentation

DocumentDescription
ContentContent, frontmatter and Hugo migration
Syntax ReferenceMarkdown extensions and directives
Assets and StylesheetsPublication, stylesheets, fingerprints and live reload
ThemesSite configuration, themes and templates
BenchmarksPerformance measurements and baseline comparisons
RoadmapDeveloper capability status, constraints and priorities

Installation

Via npm

Install Node.js 20 or newer, for example with fnm, then choose one kiln variant:

fnm install --latest --use
npm install -g @kiln-ssg/kiln@latest

Choose @kiln-ssg/kiln-extended@latest for AVIF loading placeholders. It has the same dav1d requirements as the extended archive. Both variants install kiln, so uninstall the current variant before switching.

Prereleases use the next npm tag. Supported platforms are Linux x86_64 (glibc), Apple Silicon and Windows x86_64.

Add optional tools to the same installation command when your site needs them:

npm install -g @kiln-ssg/kiln@latest @kiln-ssg/[email protected] [email protected]
  • @kiln-ssg/tailwindcss: required when the site or theme compiles Tailwind CSS.
  • pagefind: required when search is enabled.

Prebuilt binary

Download the latest release for your platform from Releases:

# Linux x86_64
curl -fsSL https://github.com/hakula139/kiln/releases/latest/download/kiln-x86_64-unknown-linux-gnu.tar.gz | tar -xz
sudo mv kiln /usr/local/bin/

# macOS aarch64 (Apple Silicon)
curl -fsSL https://github.com/hakula139/kiln/releases/latest/download/kiln-aarch64-apple-darwin.tar.gz | tar -xz
sudo mv kiln /usr/local/bin/

# Windows x86_64 (Git Bash / MSYS / WSL)
curl -fsSLO https://github.com/hakula139/kiln/releases/latest/download/kiln-x86_64-pc-windows-msvc.zip
unzip kiln-x86_64-pc-windows-msvc.zip

kiln --version

Choose the default kiln-<target> archive or kiln-extended-<target> for AVIF loading placeholders. Only extended binaries need dav1d:

PlatformExtended runtime requirement
LinuxSystem libdav1d package
macOSbrew install dav1d
WindowsIncluded in the binary

From source

cargo install --git https://github.com/hakula139/kiln --locked

To generate loading placeholders for AVIF images, install the native dependencies and enable the feature:

cargo install --git https://github.com/hakula139/kiln --locked --features avif

Via Nix

nix run github:hakula139/kiln -- build     # one-shot
nix profile install github:hakula139/kiln  # install to user profile

The flake offers the hakula Cachix cache for prebuilt packages. Nix prompts for trust interactively. For noninteractive use, verify the cache key before passing --accept-flake-config.

To use this cache from another flake, configure it in that flake or your Nix installation.

To use kiln in another flake, add this input:

inputs.kiln.url = "github:hakula139/kiln";
# Outputs: packages.${system}.{default,kiln}

The Nix package puts the Tailwind compiler and Pagefind on kiln's PATH, so stylesheet compilation and search work without separate installs.

First Site

Create a site with IgnIt, using a kiln version meeting the theme's min_kiln_version. IgnIt requires the Tailwind processor, which is included in kiln's Nix package.

git init my-site
cd my-site
git submodule add https://github.com/hakula139/IgnIt.git themes/IgnIt
mkdir -p content/posts/hello

cat > config.toml <<'CONFIG'
base_url = "https://example.com"
title = "My Site"
theme = "IgnIt"
CONFIG

cat > content/posts/hello/index.md <<'POST'
+++
title = "Hello"
+++

Welcome to my site.
POST

kiln serve --open

Run kiln build --minify to generate public/ for deployment. See Site Configuration for engine settings and Content for organizing pages.

Usage

kiln build --root /path/to/site --minify
kiln build --base-url https://preview.example.com
kiln serve --port 3000 --open
kiln init-theme my-theme
kiln convert --source /path/to/hugo --dest /path/to/kiln

build, serve and init-theme use the current directory as the site root unless --root is supplied. KILN_BASE_URL supplies a build URL override when --base-url is absent.

See Hugo migration for the converter's supported scope and manual follow-up.

Search is disabled by default. To enable it, install Pagefind and set [search] enabled = true in config.toml:

[search]
enabled = true
# binary = "/path/to/pagefind"  # optional, if not on $PATH

kiln build and kiln serve run Pagefind after HTML generation when search is enabled.

Building from Source

Requires Rust 1.89 or newer and a C toolchain.

cargo build --release  # Binary at target/release/kiln

AVIF placeholders

Image publication and dimension detection work in either build. To add AVIF loading placeholders, install dav1d ≥ 1.3 and pkg-config:

PlatformBuild dependencies
macOSXcode command-line tools and brew install dav1d pkg-config
Debian / Ubuntusudo apt install build-essential libdav1d-dev pkg-config

Then enable the feature:

cargo build --release --features avif

On macOS and Linux, the resulting binary needs dav1d at runtime, like the extended archives.

Reproducible dev shell (Nix)

The Nix package enables AVIF support by default. Its development shell provides the build dependencies and pre-commit hooks:

nix develop      # interactive shell
nix flake check  # run the pre-commit hooks that don't use Node

direnv auto-activates the shell via .envrc.

License

Copyright (c) 2026 Hakula. Licensed under the MIT License.

版本与发布记录

@kiln-ssg/kiln 共发布 7 个版本,首次发布于 2026/10/11;过去 12 个月发布了 7 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.5.2latest2026/11/011 天前
0.5.12026/10/259 天前
0.5.02026/10/1815 天前
0.5.0-alpha.4next2026/10/1321 天前
0.5.0-alpha.32026/10/1222 天前
0.5.0-alpha.12026/10/1123 天前

关于 @kiln-ssg/kiln 的常见问题

@kiln-ssg/kiln 是什么?

窑炉静态现场发生器

如何安装 @kiln-ssg/kiln?

在项目目录运行 npm install @kiln-ssg/kiln,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 kiln,可以用 npx kiln 直接运行。

@kiln-ssg/kiln 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/kiln-ssg__kiln 是否存在。

@kiln-ssg/kiln 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@kiln-ssg/kiln 可以商用吗?

@kiln-ssg/kiln 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@kiln-ssg/kiln 还在维护吗?

最新版本 0.5.2 发布于 2026/11/01(1 天前);至今共发布 7 个版本,其中过去 12 个月发布了 7 个;首次发布于 2026/10/11。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。