Bengal provides a template system for scaffolding new sites with predefined structures. This reference covers all CLI commands and template options.
CLI Commands Overview
| Command | Purpose | When to Use |
|---|---|---|
bengal new site |
Create new site from template | Starting a new project |
bengal project init |
Add sections to existing site | Expanding site structure |
bengal config init |
Initialize config directory | Converting single-file to directory config |
bengal new site
Create a new Bengal site from a template.
Syntax
bengal new site [NAME] [OPTIONS]
Arguments
| Argument | Required | Description |
|---|---|---|
NAME |
No | Site directory name (prompted if omitted) |
Options
| Option | Default | Description |
|---|---|---|
--template |
default |
Site template (see templates below) |
--theme |
default |
Theme to use |
--no-init |
false |
Skip structure initialization wizard |
--init-preset |
- | Preset name for non-interactive mode |
Examples
1 2 3 4 5 6 7 8 | |
What Gets Created
All templates create:
config/directory with environment-aware configurationcontent/directory with template-specific pages.gitignorefor Bengal-specific files
bengal project init
Initialize content sections in an existing Bengal site.
Syntax
bengal project init [OPTIONS]
Options
| Option | Type | Default | Description |
|---|---|---|---|
--sections,-s |
Multiple | blog |
Section names to create |
--with-content |
Flag | false |
Generate sample pages |
--pages-per-section |
Integer | 3 |
Sample pages per section |
--dry-run |
Flag | false |
Preview without creating |
--force |
Flag | false |
Overwrite existing sections |
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
Section Type Inference
Section names are mapped to content types:
| Name Pattern | Type | Description |
|---|---|---|
blog,posts,articles,news |
blog |
Date-sorted content |
docs,documentation,guides,reference,tutorials |
doc |
Weight-sorted content |
| All others | section |
Standard section |
Generated Files
For each section, Bengal creates:
1 2 3 4 5 | |
Sample page names are context-aware:
- Blog:
welcome-post,getting-started,tips-and-tricks - Docs:
introduction,quickstart,installation - Projects:
project-alpha,project-beta,project-gamma
bengal config init
Initialize configuration directory structure in an existing project.
Syntax
bengal config init [SOURCE] [OPTIONS]
Arguments
| Argument | Default | Description |
|---|---|---|
SOURCE |
. |
Directory to initialize |
Options
| Option | Default | Description |
|---|---|---|
--type |
directory |
Config structure (directoryorfile) |
--template |
docs |
Config preset (docs,blog,minimal) |
--force |
false |
Overwrite existing config files |
Examples
1 2 3 4 5 6 7 8 | |
Directory Structure Created
1 2 3 4 5 6 7 8 9 10 11 | |
Built-in Templates
default
Minimal starter with single index page.
Structure:
1 2 | |
Best for: Minimal sites, custom builds from scratch.
docs
Full documentation site with common sections.
Structure:
1 2 3 4 5 6 7 8 9 10 | |
Config preset: Enables search, TOC depth 3, doc-style sorting.
Best for: Technical documentation, knowledge bases, API docs.
blog
Blog with posts section and about page.
Structure:
1 2 3 4 5 6 | |
Config preset: Enables RSS, date-sorted posts, excerpt generation.
Best for: Personal blogs, news sites, journals.
portfolio
Project showcase with contact page.
Structure:
1 2 3 4 5 6 7 8 | |
Best for: Developer portfolios, agency sites, project showcases.
resume
CV/Resume with structured data.
Structure:
1 2 3 4 5 | |
Best for: Personal CVs, professional profiles.
landing
Marketing landing page with legal pages.
Structure:
1 2 3 4 | |
Best for: Product landing pages, marketing sites.
changelog
Version history with structured data.
Structure:
1 2 3 4 5 | |
Best for: Release notes, version history.
Template Architecture
How Templates Work
Templates are defined inbengal/cli/templates/<name>/:
1 2 3 4 5 6 7 | |
SiteTemplate Class
1 2 3 4 5 6 7 8 | |
TemplateFile Class
1 2 3 4 5 | |
Config Directory Structure
All templates create this config structure:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | |
Environment-Specific Config
1 2 3 4 5 6 7 8 9 10 | |
Related Documentation
- Configuration Concepts - How config works
- Configuration System - Architecture details
- Scaffold Tutorial - Step-by-step guide