bundle.website.core.pages

Reusable page registration primitives for website sites.

Classes

Page

Structural interface a page module must satisfy to be registered.

Functions

mount_page(→ None)

Attach a single page router and its static directory to the app.

initialize_pages(→ tuple[Page, Ellipsis])

Attach all pages and expose registry/navigation metadata on app state.

Module Contents

class bundle.website.core.pages.Page

Bases: Protocol

Structural interface a page module must satisfy to be registered.

name: str
slug: str
href: str
description: str
router: fastapi.routing.APIRouter
static_path: pathlib.Path | None
show_in_nav: bool
show_on_home: bool
bundle.website.core.pages.mount_page(app: fastapi.FastAPI, page: Page) None

Attach a single page router and its static directory to the app.

bundle.website.core.pages.initialize_pages(app: fastapi.FastAPI, pages: collections.abc.Iterable[Page]) tuple[Page, Ellipsis]

Attach all pages and expose registry/navigation metadata on app state.