# Migration

URL: /bengal/docs/build-sites/customize/templating/kida/migration/
Section: migration
Description: Migrating to Kida from Jinja2

---

> For a complete page index, fetch /bengal/llms.txt.

Note

Do I need this? Yes when converting Jinja2 templates to Kida-native
syntax. Most templates work unchanged — migrate incrementally.

Most Jinja2 templates work without changes in Kida. Migrate incrementally to use unified`{% end %}` blocks, pattern matching, and pipeline operators. Note that Kida does not support all Jinja2 features (notably `{% macro %}`—use `{% def %}` instead). If you need full Jinja2 compatibility, use the Jinja2 engine by setting `template_engine: jinja2`in your config.

## Migration Strategy

- Compatibility Mode — Existing Jinja2 templates work as-is

- Gradual Migration — Convert templates incrementally as you edit them

- Full Migration — Use Kida syntax throughout

## Quick Syntax Changes

Jinja2
Kida

`{% endif %}`, `{% endfor %}`
`{% end %}`

`{% set x = ... %}`
`{% let x = ... %}`

`{% if %}...{% elif %}`
`{% match %}...{% case %}`

`| selectattr('key', 'eq', val)`
`|> where('key', val)`

`| sort(attribute='key')`
`|> sort_by('key')`

`| default(value)`
`?? value`(simple)

Note

Template Functions:`where` and `sort_by` are Bengal template functions (not Kida built-ins) that are automatically available in all templates. They work with both `\|` (Jinja2-style) and `\|>`(Kida pipeline) operators.

## Topics

From Jinja2

Convert existing Jinja2 templates to Kida syntax

(/bengal/docs/build-sites/customize/templating/kida/migration/from-jinja/)

## In This Section

From Jinja2 (/bengal/docs/build-sites/customize/templating/kida/migration/from-jinja/)

Convert existing Jinja2 templates to Kida syntax

Related Pages

Templating (/bengal/docs/build-sites/customize/templating/)

Kida template engine, layouts, inheritance, and partials

Related

Assets (/bengal/docs/build-sites/customize/assets/)

CSS, JavaScript, images, and fonts

Related

Build Sites (/bengal/docs/build-sites/)

Write, structure, customize, and extend your Bengal site

Related

Theming (/bengal/docs/build-sites/customize/)

Templates, assets, and visual customization

Related

Template Cookbook (/bengal/docs/build-sites/customize/recipes/)

Common templating patterns and Bengal-specific features

Related

persona-themer (/bengal/tags/persona-themer/)
