Module

orchestration.static

Static file orchestrator - copies static/ to output verbatim.

This enables raw HTML pages, downloadable files, and other assets that need to bypass the content pipeline while still having access to theme assets via /assets/css/style.css.

Key Concepts:

  • Verbatim copying: Files copied as-is without processing
  • Directory preservation: Maintains directory structure from static/
  • Size warnings: Warns when static folder exceeds size threshold
  • Theme asset access: Static files can reference theme assets

Related Modules:

  • bengal.orchestration.asset: Asset processing (for theme assets)
  • bengal.core.site: Site container with static directory

Usage:

static/demos/holo.html  → public/demos/holo.html
static/downloads/app.pdf → public/downloads/app.pdf
static/robots.txt        → public/robots.txt

See Also:

  • bengal/orchestration/static.py: process_static_files() for processing logic

Classes

StaticOrchestrator
Orchestrates static file copying to output directory. Copies files from static/ directory to outpu…
6

Orchestrates static file copying to output directory.

Copies files from static/ directory to output directory verbatim without any processing. Preserves directory structure and warns about large static folders that might impact build performance.

Creation:

Direct instantiation: StaticOrchestrator(site)
  • Created by BuildOrchestrator during build
  • Requires Site instance with root_path and output_dir

Attributes

Name Type Description
site

Site instance with root_path and output_dir

logger

Logger instance for static file operations

static_dir

Path to static/ directory (from config or default)

output_dir

Output directory path

enabled

Whether static file copying is enabled

Relationships
  • Used by: BuildOrchestrator for static file copying phase - Uses: Site for directory paths and configuration Thread Safety: Thread-safe for parallel file copying operations.

Methods 5

is_enabled
Check if static folder exists and is enabled.
0 bool
def is_enabled(self) -> bool

Check if static folder exists and is enabled.

Returns

bool

get_total_size
Calculate total size of static folder in bytes.
0 int
def get_total_size(self) -> int

Calculate total size of static folder in bytes.

Returns

int

copy
Copy static files to output directory. Files are copied verbatim without any p…
0 int
def copy(self) -> int

Copy static files to output directory.

Files are copied verbatim without any processing. Directory structure is preserved.

Returns

int

Number of files copied

copy_single
Copy a single static file (for incremental updates).
1 bool
def copy_single(self, rel_path: Path | str) -> bool

Copy a single static file (for incremental updates).

Parameters 1
rel_path Path | str

Path relative to static folder

Returns

bool

True if file was copied successfully

remove_single
Remove a single static file from output (when source is deleted).
1 bool
def remove_single(self, rel_path: Path | str) -> bool

Remove a single static file from output (when source is deleted).

Parameters 1
rel_path Path | str

Path relative to static folder

Returns

bool

True if file was removed successfully

Internal Methods 1
__init__
1 None
def __init__(self, site: Site) -> None
Parameters 1
site Site