Core Concepts

Foundational concepts for understanding Bengal

2 min read 308 words

Understand how Bengal organizes content, processes files, and generates sites.

The Build Model

flowchart LR subgraph Input A[Content .md] B[Templates .html] C[Assets CSS/JS] end subgraph Process D[Discovery] E[Rendering] F[Post-process] end subgraph Output G[public/] end A --> D B --> E C --> F D --> E --> F --> G

Key Concepts

Concept What It Means
Page A single content file (.md) → single HTML output
Section A directory with_index.md→ list page with children
Leaf Bundle A directory withindex.md→ page with co-located assets
Template Kida/Jinja2 HTML that wraps your content
Asset CSS, JS, images — processed, optimized, and fingerprinted
Cascade Metadata inheritance from section_index.mdto child pages

Mental Model

Your file structure becomes your URL structure:

content/blog/hello.md → /blog/hello/
content/docs/_index.md → /docs/

Templates wrap content in HTML. Bengal provides 80+ template helpers:

page.content + single.html → final HTML

Static files are copied, optimized, and fingerprinted for cache-busting:

assets/css/main.css → public/assets/css/main.a1b2c3.css

Tip

Start simple: Most sites only need pages and a theme. Add sections when you need grouping, leaf bundles when you need co-located assets.

Deep Dives

These concepts are covered in detail in their respective sections:

Concept Learn More
Content Organization Content Structure — frontmatter, sections, bundles
Templates Kida Templating — syntax, caching, performance
Assets Asset Pipeline — CSS, JS, images, optimization
Build Process Configuration — profiles, environment settings
Output Formats Output Formats — JSON, LLM text, search index