Module

core.page.utils

Utilities for page operations and helpers.

Functions

separate_standard_and_custom_fields
Separate standard frontmatter fields from custom props. Standard fields are extracted to PageCore …
1 tuple[dict[str, Any…
def separate_standard_and_custom_fields(metadata: dict[str, Any]) -> tuple[dict[str, Any], dict[str, Any]]

Separate standard frontmatter fields from custom props.

Standard fields are extracted to PageCore fields. Custom fields go into props.

Note: For markdown files, frontmatter should be flat (no props: nesting). The props: key is primarily for skeleton manifests (bengal skeleton apply), where it helps group custom data separately from structural fields.

Parameters 1

Name Type Default Description
metadata dict[str, Any]

Full frontmatter metadata dict (will be modified in place)

Returns

tuple[dict[str, Any], dict[str, Any]]

Tuple of (standard_fields_dict, custom_props_dict)

create_synthetic_page
Create a synthetic page object (SimpleNamespace) that mimics the Page interface. Used for special …
11 SimpleNamespace
def create_synthetic_page(title: str, description: str, url: str, kind: str = 'page', type: str = 'special', variant: str | None = None, draft: bool = False, metadata: dict[str, Any] | None = None, tags: list[str] | None = None, keywords: list[str] | None = None, content: str = '') -> SimpleNamespace

Create a synthetic page object (SimpleNamespace) that mimics the Page interface.

Used for special pages like 404, search, and sitemap which don't have backing markdown files but need to be rendered using theme templates.

Parameters 11

Name Type Default Description
title str

Page title

description str

Page description

url str

Page URL (absolute or relative to base)

kind str 'page'

Page kind (page, section, home)

type str 'special'

Component Model type (default: special)

variant str | None None

Component Model variant (default: None)

draft bool False

Draft status

metadata dict[str, Any] | None None

Additional metadata

tags list[str] | None None

List of tags

keywords list[str] | None None

List of keywords

content str ''

Page content

Returns

SimpleNamespace

SimpleNamespace object with Page-like attributes