Bengal supports TOML, YAML, and directory-based configuration files.
Configuration Structure
Bengal configuration follows a Three-Layer Architecture to separate concerns:
site(Identity & Metadata)- Who you are: title, author, baseurl
- Structure: menus, taxonomies
- Does NOT control content processing.
content(Processing Pipeline)- How Bengal computes content: excerpts, reading time, TOC depth
- This is the API that themes rely on.
- Why separate this? It allows you to switch themes without breaking your content model or SEO metadata. The theme just displays what Bengal computed.
params(User Variables)- Custom site-specific data
- Accessible in templates as
{{ site.config.params.foo }}
File Formats & Locations
Bengal looks for configuration in the following order:
bengal.toml(Recommended for simple sites)bengal.yaml/bengal.ymlconfig.tomlconfig.yaml/config.ymlconfig/directory (Recommended for complex sites)
Directory-Based Config
For larger sites, you can split configuration into multiple files:
1 2 3 4 5 6 7 8 9 10 | |
Reference
[site]
General site identity and metadata.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
[content]
Controls how Bengal processes and organizes content.
| Setting | Default | Description |
|---|---|---|
default_type |
"doc" |
Default content type for sections |
excerpt_length |
200 |
Length of auto-generated excerpts |
reading_speed |
250 |
Words per minute for reading time calculation |
related_count |
3 |
Number of related posts to find |
toc_depth |
3 |
Depth of Table of Contents (h1-h3) |
sort_pages_by |
"weight" |
Default sort key (weight,date,title) |
[markdown]
Configure the Markdown parsing engine.
1 2 | |
Note:mistuneis significantly faster (2-5x) and recommended for most sites. Usepython-markdownonly if you rely on specific Python-Markdown extensions.
[build]
Build process settings.
1 2 3 4 5 6 | |
Note:max_workersdefaults to auto-detection based on your CPU cores (leaves 1 core for OS, minimum 4 workers). Set a specific number to override.
[assets]
Asset pipeline configuration.
1 2 3 4 5 6 7 8 9 10 | |
[output_formats]
Configure alternative output formats (JSON, LLM text).
1 2 3 4 5 6 7 8 | |
[params]
Arbitrary user parameters.
Warning
Security Warning: Do not put secrets (API keys, passwords) in your configuration files if you commit them to public repositories. Bengal does not currently support environment variable substitution for arbitrary parameters.
1 2 3 4 | |