Functions
register
2
None
▼
Register functions with template environment.
register
2
None
▼
def register(env: TemplateEnvironment, site: SiteLike) -> None
Parameters
| Name | Type | Description |
|---|---|---|
env |
TemplateEnvironment |
|
site |
SiteLike |
read_file
2
str
▼
Read file contents.
Uses bengal.utils.file_io.read_text_file internally for ro…
read_file
2
str
▼
def read_file(path: str, root_path: Path) -> str
Read file contents.
Uses bengal.utils.file_io.read_text_file internally for robust file reading with UTF-8/latin-1 encoding fallback and comprehensive error handling.
Parameters
| Name | Type | Description |
|---|---|---|
path |
str |
Relative path to file |
root_path |
Path |
Site root path |
Returns
str
file_exists
2
bool
▼
Check if file exists.
file_exists
2
bool
▼
def file_exists(path: str, root_path: Path) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
path |
str |
Relative path to file |
root_path |
Path |
Site root path |
Returns
bool
file_size
2
str
▼
Get human-readable file size.
file_size
2
str
▼
def file_size(path: str, root_path: Path) -> str
Parameters
| Name | Type | Description |
|---|---|---|
path |
str |
Relative path to file |
root_path |
Path |
Site root path |
Returns
str