Scaffold Your First Site

Create a Bengal site from a template in 5 minutes

4 min read 836 words
Edit this page

Was this page helpful?

Bengal provides built-in templates to quickly create sites with common information architectures. This tutorial covers three ways to scaffold a site.

Quick Start: Template-Based Creation

The fastest way to start is with a template:

BASH
# Create a documentation site
bengal new site my-docs --template docs

# Navigate and preview
cd my-docs
bengal serve

Open http://localhost:5173to see your scaffolded site.

Available Templates

Template Best For Command
default Minimal single-page site bengal new site --template default
docs Technical documentation, knowledge bases bengal new site --template docs
blog Personal blogs, news sites bengal new site --template blog
portfolio Developer portfolios, project showcases bengal new site --template portfolio
product Product showcase sites bengal new site --template product
resume CV/Resume with structured data bengal new site --template resume

What Gets Created

When you runbengal new site my-docs --template docs, Bengal creates:

TREE-SITTER-QUERY
my-docs/
├── config/
│   ├── _default/
│   │   ├── site.yaml        # Site identity (title, author, baseurl)
│   │   ├── content.yaml     # Content processing settings
│   │   ├── build.yaml       # Build configuration
│   │   ├── features.yaml    # Feature toggles
│   │   ├── theme.yaml       # Theme configuration
│   │   └── params.yaml      # Custom variables
│   └── environments/
│       ├── local.yaml       # Development overrides
│       └── production.yaml  # Production settings
├── content/
│   ├── index.md             # Home page
│   ├── getting-started/     # Onboarding section
│   │   ├── _index.md
│   │   ├── installation.md
│   │   └── quickstart.md
│   ├── guides/              # How-to guides
│   │   └── _index.md
│   └── api/                 # API reference
│       └── _index.md
└── .gitignore

Method 1: Interactive Wizard

For a guided experience, run without arguments:

BASH
bengal new site

The wizard prompts for:

  1. Site name (creates directory)
  2. Base URL (for production deployment)
  3. Template (select from list)

Method 2: Direct Template Selection

Skip prompts with explicit options:

BASH
# Blog with custom name
bengal new site my-blog --template blog

# Portfolio at specific URL
bengal new site portfolio --template portfolio

Method 3: Add Sections to an Existing Site

Bengal has no command for retrofitting sections into an existing site — content lives in plain files, so you add a section by creating its directory and an_index.md:

BASH
# Add a docs section
mkdir -p content/docs
$EDITOR content/docs/_index.md

# Add a tutorials section
mkdir -p content/tutorials
$EDITOR content/tutorials/_index.md

Bengal infers a section's content type from its directory name:

Name Pattern Inferred Type Behavior
blog, posts, articles, news blog Date-sorted, post-style
docs, documentation, guides, tutorials doc Weight-sorted, doc-style
projects, portfolio section Standard section
about, contact section Standard section

You can override the inferred type by settingtype: (or a cascade.type:) in the section's_index.mdfrontmatter.

Customizing After Scaffolding

  1. 1

    Update Site Identity

    Replace placeholder values with your project's actual metadata.

    Editconfig/_default/site.yaml:

    YAML
    site:
      title: "My Documentation"
      description: "Documentation for my project"
      author: "Your Name"
      baseurl: "https://docs.example.com"
    
  2. 2

    Configure Features

    Enable RSS feeds, search, sitemaps, and other built-in features.

    Editconfig/_default/features.yaml:

    YAML
    features:
      rss: true       # Generate RSS feed
      sitemap: true   # Generate sitemap.xml
      search: true    # Enable search
      json: true      # Generate JSON API
      llm_txt: true   # Generate llms.txt
    
  3. 3

    Add Your Content

    Replace placeholder content incontent/:

    BASH
    # Edit home page
    $EDITOR content/index.md
    
    # Add new page
    touch content/getting-started/configuration.md
    

Preview and Build

BASH
# Live preview with hot reload
bengal serve

# Production build
bengal build

# Build with specific environment
bengal build --environment production

Skeleton Manifests

Bengal's site templates are powered by skeleton manifestsskeleton.yamlfiles that define a complete site structure (frontmatter, cascades, and content stubs). They are not a separate CLI step: when you drop askeleton.yamlinto a template directory, Bengal materializes it automatically duringbengal new site.

BASH
# Scaffold a site from a template backed by a skeleton manifest
bengal new site api-docs --template api-docs

See Create Custom Skeletons for the full guide on writing skeleton YAML files.

Next Steps

Troubleshooting