Functions
build_versions_json
1
list[dict[str, Any]]
▼
Build Mike-compatible versions.json structure from VersionConfig.
build_versions_json
1
list[dict[str, Any]]
▼
def build_versions_json(version_config: VersionConfig) -> list[dict[str, Any]]
Parameters
| Name | Type | Description |
|---|---|---|
version_config |
VersionConfig |
Site versioning configuration |
Returns
list[dict[str, Any]]
write_versions_json
2
None
▼
Write versions.json to output directory when versioning enabled.
Emits to publ…
write_versions_json
2
None
▼
def write_versions_json(site: Any, output_dir: Path) -> None
Write versions.json to output directory when versioning enabled.
Emits to public/versions.json (or deploy_prefix/versions.json if set). Only runs when versioning.enabled and versioning.emit_versions_json (default True).
Parameters
| Name | Type | Description |
|---|---|---|
site |
Any |
Site instance with version_config |
output_dir |
Path |
Output directory (e.g. site.output_dir) |
write_root_redirect
2
None
▼
Write root index.html redirect to default version when enabled.
Creates a meta…
write_root_redirect
2
None
▼
def write_root_redirect(site: Any, output_dir: Path) -> None
Write root index.html redirect to default version when enabled.
Creates a meta-refresh + JS redirect page at output_dir/index.html. Only runs when versioning.default_redirect is True. Overwrites any existing index.html at root—use only for docs-only versioned sites.
Parameters
| Name | Type | Description |
|---|---|---|
site |
Any |
Site instance with version_config |
output_dir |
Path |
Output directory |
_redirect_html
1
str
▼
Generate HTML redirect page (meta refresh + JS fallback).
Escapes href for saf…
_redirect_html
1
str
▼
def _redirect_html(href: str) -> str
Generate HTML redirect page (meta refresh + JS fallback).
Escapes href for safe use in HTML attributes and JS string literals.
Parameters
| Name | Type | Description |
|---|---|---|
href |
str |
Returns
str
_write_if_changed_atomic
3
None
▼
Write file atomically only if content differs.
_write_if_changed_atomic
3
None
▼
def _write_if_changed_atomic(path: Path, content: str, atomic_file_cls: type) -> None
Parameters
| Name | Type | Description |
|---|---|---|
path |
Path |
|
content |
str |
|
atomic_file_cls |
type |