Classes
SitePropertiesMixin
Mixin providing property accessors for site configuration.
Requires these attributes on the host c…
SitePropertiesMixin
Mixin providing property accessors for site configuration.
Requires these attributes on the host class:
- config: dict[str, Any]
- root_path: Path
- _theme_obj: Theme | None
- _config_hash: str | None
- _query_registry: Any
Attributes
| Name | Type | Description |
|---|---|---|
config |
dict[str, Any] |
|
root_path |
Path |
|
_theme_obj |
Theme | None |
|
_config_hash |
str | None |
|
_query_registry |
Any |
Methods 6
title
property
Get site title from configuration.
title
property def title(self) -> str | None
Get site title from configuration.
Returns
Site title string from config, or None if not configuredstr | None
—
baseurl
property
Get site baseurl from configuration.
Baseurl is prepended to all page URLs. Ca…
baseurl
property def baseurl(self) -> str | None
Get site baseurl from configuration.
Baseurl is prepended to all page URLs. Can be empty, path-only (e.g., "/blog"), or absolute (e.g., "https://example.com").
Returns
Base URL string from config, or None if not configuredstr | None
—
author
property
Get site author from configuration.
author
property def author(self) -> str | None
Get site author from configuration.
Returns
Author name string from config, or None if not configuredstr | None
—
config_hash
property
Get deterministic hash of the resolved configuration.
Used for automatic cache…
config_hash
property def config_hash(self) -> str
Get deterministic hash of the resolved configuration.
Used for automatic cache invalidation when configuration changes.
The hash captures the effective config state including:
- Base config from files
- Environment variable overrides
- Build profile settings
Returns
16-character hex string (truncated SHA-256)str
—
theme_config
property
Get theme configuration object.
Available in templates as `site.theme_config` …
theme_config
property def theme_config(self) -> Theme
Get theme configuration object.
Available in templates assite.theme_configfor accessing theme settings:
- site.theme_config.name: Theme name
- site.theme_config.default_appearance: Default light/dark/system mode
- site.theme_config.default_palette: Default color palette
- site.theme_config.config: Additional theme-specific config
Returns
Theme configuration objectTheme
—
indexes
property
Access to query indexes for O(1) page lookups.
Provides pre-computed indexes f…
indexes
property def indexes(self) -> QueryIndexRegistry
Access to query indexes for O(1) page lookups.
Provides pre-computed indexes for common page queries: site.indexes.section.get('blog') # All blog posts site.indexes.author.get('Jane Smith') # Posts by Jane site.indexes.category.get('tutorial') # Tutorial pages site.indexes.date_range.get('2024') # 2024 posts
Indexes are built during the build phase and provide O(1) lookups instead of O(n) filtering. This makes templates scale to large sites.
Returns
QueryIndexRegistry instanceQueryIndexRegistry
—
Internal Methods 1
_compute_config_hash
Compute and cache the configuration hash.
Calculates SHA-256 hash of resolved …
_compute_config_hash
def _compute_config_hash(self) -> None
Compute and cache the configuration hash.
Calculates SHA-256 hash of resolved configuration (including env overrides
and build profiles) and stores it in_config_hash. Used for automatic
cache invalidation when configuration changes.
Called during post_init to ensure hash is available immediately. Subsequent calls use cached value unless config changes.