# Kiln > A fast, safe template language for building websites. Familiar syntax, async data, and it runs on Node and Cloudflare Workers. Install it with `npm install @lucidkiln/core`. Things to know when writing Kiln templates: - The syntax is close to Twig: `{{ value }}` prints, `{% tag %}` runs logic, `{# comment #}` is ignored. - Names of filters, functions, tests and variables are camelCase, like JavaScript: `formatDate`, not `format_date`. - Strict mode is on by default, so unknown variables, properties, filters and functions are errors. - Output is HTML-escaped by default. `raw` marks trusted HTML. - Templates can call async functions to load data. Kiln only waits where a call returns a promise. - Kiln has no runtime dependencies and runs on Node 24 and Cloudflare Workers. ## Getting started - [Introduction](https://kilnlang.com/docs.md): What Kiln is, and what it is good at. - [Installation](https://kilnlang.com/docs/installation.md): Add Kiln to a Node or Cloudflare Workers project. - [Quick start](https://kilnlang.com/docs/quick-start.md): Render a page with a layout in a few minutes. ## Language - [Syntax](https://kilnlang.com/docs/language/syntax.md): Delimiters, comments, strings and whitespace. - [Values](https://kilnlang.com/docs/language/values.md): The types templates work with, and how they print. - [Expressions](https://kilnlang.com/docs/language/expressions.md): Operators, property access, calls, filters and tests. - [Variables and scope](https://kilnlang.com/docs/language/variables.md): Where variables come from and how long they live. - [Strict mode](https://kilnlang.com/docs/language/strict-mode.md): How Kiln catches typos and missing data. - [Escaping](https://kilnlang.com/docs/language/escaping.md): Output is escaped by default. Here is how to control it. - [Async data](https://kilnlang.com/docs/language/async-data.md): Load data from templates with async functions. ## Tags - [if](https://kilnlang.com/docs/tags/if.md): Render content only when a condition holds. - [for](https://kilnlang.com/docs/tags/for.md): Loop over arrays, hashes and other collections. - [set](https://kilnlang.com/docs/tags/set.md): Assign a value or captured markup to a variable. - [props](https://kilnlang.com/docs/tags/props.md): Declare the variables a template expects. - [extends and block](https://kilnlang.com/docs/tags/extends.md): Share a layout between pages. - [include](https://kilnlang.com/docs/tags/include.md): Render another template in place. - [component](https://kilnlang.com/docs/tags/component.md): Build reusable pieces of markup with props and slots. - [island](https://kilnlang.com/docs/tags/island.md): Load part of a page after the rest, for live or slow data. - [macro and import](https://kilnlang.com/docs/tags/macro.md): Define small reusable snippets you call like functions. - [with](https://kilnlang.com/docs/tags/with.md): Add variables for a section of a template. - [cache](https://kilnlang.com/docs/tags/cache.md): Save a section's output and reuse it in later renders. - [outlet and add](https://kilnlang.com/docs/tags/outlet.md): Let components add styles and scripts to the page's head. - [flush](https://kilnlang.com/docs/tags/flush.md): Close outlets so a streamed page can be sent so far. - [apply](https://kilnlang.com/docs/tags/apply.md): Run a section of output through filters. - [autoescape](https://kilnlang.com/docs/tags/autoescape.md): Change how output is escaped for a section. - [verbatim](https://kilnlang.com/docs/tags/verbatim.md): Output Kiln syntax without running it. ## Reference - [String filters](https://kilnlang.com/docs/filters/strings.md): Filters for changing and encoding text. - [List filters](https://kilnlang.com/docs/filters/lists.md): Filters for arrays, hashes and other collections. - [Number and date filters](https://kilnlang.com/docs/filters/numbers-and-dates.md): Round numbers, pick plurals and format numbers and dates with Intl. - [Functions](https://kilnlang.com/docs/functions.md): Built-in functions, from range to attrs. - [Tests](https://kilnlang.com/docs/tests.md): Built-in tests for use with is. ## JavaScript API - [Creating an environment](https://kilnlang.com/docs/api/create-kiln.md): Set up Kiln with createKiln and its options. - [Rendering](https://kilnlang.com/docs/api/rendering.md): Render pages, single blocks and request data. - [Streaming](https://kilnlang.com/docs/api/streaming.md): Send the page in parts while it renders. - [Loaders](https://kilnlang.com/docs/api/loaders.md): Tell Kiln where templates come from. - [Precompiling](https://kilnlang.com/docs/api/precompiling.md): Compile your templates to JavaScript at build time. - [Functions, filters and tests](https://kilnlang.com/docs/api/extending.md): Add your own functions, filters, tests and globals. - [Safe markup and classes](https://kilnlang.com/docs/api/safe-markup.md): Return trusted HTML and expose class instances. - [Errors and checks](https://kilnlang.com/docs/api/errors.md): Handle errors and check templates before rendering. - [TypeScript types](https://kilnlang.com/docs/api/types.md): Generate types for render from your templates' props. - [Safety and limits](https://kilnlang.com/docs/api/safety.md): Run templates you didn't write. ## Tooling - [Formatting](https://kilnlang.com/docs/tooling/formatting.md): Format templates from the command line or JavaScript. - [Editor support](https://kilnlang.com/docs/tooling/editors.md): The language server and the Zed extension. - [HTML checks](https://kilnlang.com/docs/tooling/html-checks.md): Warnings for obsolete and inaccessible HTML, before you render. ## Guides - [Compared with other languages](https://kilnlang.com/docs/comparison.md): What Kiln has next to Twig, Nunjucks, LiquidJS and Handlebars. - [Coming from Twig](https://kilnlang.com/docs/coming-from-twig.md): What is the same, what changed and why. - [Benchmarks](https://kilnlang.com/docs/benchmarks.md): How fast Kiln renders real pages, compared with other JavaScript template engines. ## Optional - [Full documentation](https://kilnlang.com/llms-full.txt): Every docs page above in one Markdown file. - [Source code](https://github.com/buildlucid/kiln): The Kiln repository on GitHub.