Module

core.site.data

Data loading mixin for Site.

Provides methods for loading data files from the data/ directory into site.data.

Related Modules:

  • bengal.core.site.core: Main Site dataclass using this mixin
  • bengal.utils.dotdict: DotDict for dot-notation access
  • bengal.utils.file_io: Data file loading utilities

Classes

DataLoadingMixin
Mixin providing data directory loading methods. Requires these attributes on the host class: -…
2

Mixin providing data directory loading methods.

Requires these attributes on the host class:

  • root_path: Path

Attributes

Name Type Description
root_path Path
Internal Methods 2
_load_data_directory
Load all data files from the data/ directory into site.data. Supports YAML, JS…
0 DotDict
def _load_data_directory(self) -> DotDict

Load all data files from the data/ directory into site.data.

Supports YAML, JSON, and TOML files. Files are loaded into a nested structure based on their path in the data/ directory.

Returns

DotDict

DotDict with loaded data accessible via dot notation

_validate_tracks_structure
Validate tracks.yaml structure during data loading. Logs warnings for invalid …
1 None
def _validate_tracks_structure(self, tracks_data: dict[str, Any]) -> None

Validate tracks.yaml structure during data loading.

Logs warnings for invalid tracks but doesn't fail the build. This provides early feedback during development.

Parameters 1
tracks_data dict[str, Any]

Dictionary loaded from tracks.yaml