Functions
determine_output_path
Determine the output path for a page.
Delegates path computation to centralized URLStrategy (i18n-…
determine_output_path
def determine_output_path(page: Page, site: Any) -> Path
Determine the output path for a page.
Delegates path computation to centralized URLStrategy (i18n-aware).
Parameters 2
| Name | Type | Default | Description |
|---|---|---|---|
page |
Page |
— | Page to determine path for |
site |
Any |
— | Site instance |
Returns
Output pathPath
—
determine_template
Determine which template will be used for this page.
Template resolution order:
1. page.template a…
determine_template
def determine_template(page: Page) -> str
Determine which template will be used for this page.
Template resolution order:
- page.template attribute
- page.metadata['template']
- Default based on page type
Parameters 1
| Name | Type | Default | Description |
|---|---|---|---|
page |
Page |
— | Page object |
Returns
Template name (e.g., 'single.html', 'page.html')str
—
write_output
Write rendered page to output directory.
Handles:
- Directory creation with caching (reduces sysca…
write_output
def write_output(page: Page, site: Any, dependency_tracker: Any = None) -> None
Write rendered page to output directory.
Handles:
- Directory creation with caching (reduces syscalls)
- Atomic writes for crash safety (optional)
- Fast writes for dev server performance
- Source→output tracking for incremental cleanup
Parameters 3
| Name | Type | Default | Description |
|---|---|---|---|
page |
Page |
— | Page with rendered content |
site |
Any |
— | Site instance for config |
dependency_tracker |
Any |
None |
Optional tracker for output mapping |
format_html
Format HTML output (minify/pretty).
Respects page-level and site-level configuration:
- page.metad…
format_html
def format_html(html: str, page: Page, site: Any) -> str
Format HTML output (minify/pretty).
Respects page-level and site-level configuration:
- page.metadata.no_format: Skip formatting
- site.config.html_output.mode: 'minify', 'pretty', or 'raw'
- site.config.minify_html: Legacy option
Parameters 3
| Name | Type | Default | Description |
|---|---|---|---|
html |
str |
— | Rendered HTML content |
page |
Page |
— | Page being rendered |
site |
Any |
— | Site instance for config |
Returns
Formatted HTMLstr
—