bundle.website.core

Public API for website core application composition.

Submodules

Classes

SiteManifest

Minimal site contract consumed by the website core app factory.

Page

Structural interface a page module must satisfy to be registered.

Functions

create_app(→ fastapi.FastAPI)

Create a FastAPI app from the provided site manifest.

initialize_pages(→ tuple[Page, Ellipsis])

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

mount_page(→ None)

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

Package Contents

bundle.website.core.create_app(manifest: bundle.website.core.manifest.SiteManifest | None = None) fastapi.FastAPI

Create a FastAPI app from the provided site manifest.

class bundle.website.core.SiteManifest

Minimal site contract consumed by the website core app factory.

title: str = 'Bundle Website'
static_mount_path: str = '/static'
components_mount_path: str = '/components-static'
static_path: pathlib.Path | None = None
components_path: pathlib.Path | None = None
initialize_pages: InitializePages | None = None
class bundle.website.core.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.initialize_pages(app: fastapi.FastAPI, pages: collections.abc.Iterable[Page]) tuple[Page, Ellipsis]

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

bundle.website.core.mount_page(app: fastapi.FastAPI, page: Page) None

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