Bengal uses a Component Model to organize content. This aligns the backend (how files are stored) with the frontend (how themes render them).
Think of every page as a Component Instance.
| Concept | Terminology | Schema Key | Definition | Example |
|---|---|---|---|---|
| Identity | Type | type |
What is it? Determines Logic (Sorting) & Template Family. |
blog,doc,api |
| Mode | Variant | variant |
How does it look? Determines Visual State (CSS/Hero). |
magazine,wide |
| Data | Props | props |
What data does it have? Content passed to template (Frontmatter). |
author,banner |
1. Identity (Type)
The Type defines the fundamental nature of the content. It controls:
- Sorting Logic: Blog posts sort by date; Docs sort by weight.
- Template Selection:
type: bloglooks forthemes/[theme]/templates/blog/. - URL Structure: Different types may have different URL patterns.
Available Types
| Type | Sorting | Use Case |
|---|---|---|
doc |
By weight | Technical documentation, guides |
blog |
By date (newest first) | Blog posts, news, articles |
page |
By weight | Static pages (about, contact) |
changelog |
By date | Release notes |
api |
By weight | API reference documentation |
Full Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Line 5 is highlighted:type: doctells Bengal this is documentation content.
What happens:
- Page sorted by
weight(10) within its section - Uses templates from
templates/doc/ - Appears in documentation navigation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
Line 5 is highlighted:type: blogtells Bengal this is a blog post — sorted by date.
What happens:
- Page sorted by
date(newest first) - Uses templates from
templates/blog/ - Appears in blog feed and archives
- Date is required and prominently displayed
1 2 3 4 5 6 7 8 9 | |
Line 4 is highlighted:type: pagetells Bengal this is a static page.
What happens:
- Page sorted by weight if specified
- Uses templates from
templates/page/ - Not included in blog feeds or date-based archives
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
Lines 4-5 are highlighted:type: changelogwithdatetells Bengal this is a release note.
What happens:
- Page sorted by date within the releases section
- Uses templates from
templates/changelog/ - Formatted for release note presentation
2. Mode (Variant)
The Variant defines the visual presentation. It controls:
- CSS Classes: Adds
.page-variant-[name]to the<body>. - Partials: Selects specific components (e.g.,
page-hero-magazine.html). - Layout Variations: Different visual treatments for the same content type.
Available Variants
| Variant | Effect | Best For |
|---|---|---|
standard |
Default clean layout | Most content |
editorial |
Enhanced typography, wider margins | Long-form articles |
magazine |
Visual-heavy, featured images | Blog posts with media |
overview |
Landing page style | Section index pages |
wide |
Full-width content area | Code-heavy documentation |
minimal |
Stripped-down, distraction-free | Focus content |
Full Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Line 6 is highlighted:variant: editorialapplies enhanced typography for long-form reading.
Visual effect:
- Larger body text with better line height
- Pull quotes styled distinctively
- Wider content margins for readability
- Optimized for long-form reading
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
Lines 6-7 are highlighted:variant: magazinewithbanner_imagecreates a visual-first layout.
Visual effect:
- Large hero image at top
- Title overlaid on image or positioned dramatically
- Visual-first layout
- Cards and media prominently featured
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
Line 6 is highlighted:variant: overviewcreates a landing page style with card navigation.
Visual effect:
- Section-style header
- Card grid for child pages
- Navigation-focused layout
- Less text, more visual navigation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | |
Line 5 is highlighted:variant: wideprovides full-width content area for code-heavy docs.
Visual effect:
- No sidebar or narrow margins
- Code blocks have maximum width
- Tables can be wider
- Ideal for API reference with large code samples
3. Data (Props)
Props are the data you pass to the component. Any frontmatter field that isn'ttypeorvariantbecomes a prop.
In Markdown Files
Use flat frontmatter (all fields at top level):
1 2 3 4 5 6 7 8 | |
Full Examples by Content Type
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
Lines 6-17 are highlighted: all fields aftertypeare props — custom data available in templates.
In templates:
1 2 3 4 5 | |
1 2 3 4 5 6 7 8 9 10 11 12 | |
Lines 6-12 are highlighted: props customize appearance — icons, badges, navigation.
In templates:
1 2 3 4 5 6 7 8 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | |
Lines 6-19 are highlighted: rich props for portfolio pages — URLs, arrays, any structure you need.
In templates:
1 2 3 4 5 6 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
Lines 6-17 are highlighted: props for event/talk pages — links to slides, videos, event details.
In templates:
1 2 3 4 5 | |
Combining Type, Variant, and Props
Here's how all three work together in real examples:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | |
Lines 4-5 aretypeandvariant; lines 7-20 are props. All three working together:
type: blog— sorted by date, uses blog templatesvariant: magazine— visual layout with hero image- Props — author info, metadata, series tracking
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
Lines 4-5 aretypeandvariant; lines 7-15 are props. All three working together:
type: doc— sorted by weight, uses doc templatesvariant: wide— full-width for code examples- Props — versioning, related content links
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | |
Lines 4-5 aretypeandvariant; lines 7-12 are props. All three working together:
type: doc— this section contains documentationvariant: overview— landing page with card navigation- Props — card layout, section appearance
Cascading from Sections
Settypeandvariantonce in a section's_index.mdand all child pages inherit them:
1 2 3 4 5 6 7 8 9 | |
Lines 5-8 are highlighted: thecascadeblock setstypeandvariantfor all child pages automatically.
Now child pages don't need to specifytype:
1 2 3 4 5 | |
Site Skeletons
Define entire site structures using Skeleton Manifests (bengal project skeleton apply).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
Highlighted lines: Index and posts usetype: blog(lines 7-8, 14); About page usestype: page(lines 24-25) — different template family.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | |
Highlighted lines: Root setstype: docwith cascade (lines 7-10); Getting started overridesvariant: overview(line 17) for landing page style.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | |
Highlighted lines: Home page usesvariant: home(lines 7-8); Projects usevariant: project(lines 18-19) with rich props (lines 21-26).
Quick Reference
| Field | Purpose | Examples |
|---|---|---|
type |
What it is (logic + templates) | doc,blog,page,changelog |
variant |
How it looks (CSS + partials) | standard,editorial,magazine,wide,overview |
props |
Custom data for templates | author,banner_image,featured, anything else |
In Templates
1 2 3 4 5 6 7 8 9 | |
Legacy Migration
If you are coming from older Bengal versions:
| Old Field | New Field | Notes |
|---|---|---|
layout |
variant |
Automatic normalization |
hero_style |
variant |
Automatic normalization |
metadatadict |
flat props | Move fields to top level |
The system automatically normalizes these for you—no changes required to existing content.