Functions
clear_build_cache
Clear Bengal's build cache to force a clean rebuild.
Useful when:
- Config changes in ways that af…
clear_build_cache
def clear_build_cache(site_root_path: str | Path, logger: BengalLogger | None = None) -> bool
Clear Bengal's build cache to force a clean rebuild.
Useful when:
- Config changes in ways that affect output (baseurl, theme, etc.)
- Stale cache is suspected
- Forcing a complete regeneration
Parameters 2
| Name | Type | Default | Description |
|---|---|---|---|
site_root_path |
str | Path |
— | Path to site root directory |
logger |
BengalLogger | None |
None |
Optional logger for debug output |
Returns
True if cache was cleared, False if no cache existedbool
—
clear_output_directory
Clear the output directory (public/) to force complete regeneration.
This is necessary when build …
clear_output_directory
def clear_output_directory(output_dir_path: str | Path, logger: BengalLogger | None = None) -> bool
Clear the output directory (public/) to force complete regeneration.
This is necessary when build artifacts may contain stale values that won't be updated by incremental builds (e.g., baseurl baked into HTML meta tags).
Parameters 2
| Name | Type | Default | Description |
|---|---|---|---|
output_dir_path |
str | Path |
— | Path to output directory (e.g., site/public) |
logger |
BengalLogger | None |
None |
Optional logger for debug output |
Returns
True if directory was cleared, False if didn't exist or error occurredbool
—