@anzaui/engine - v0.6.0
    Preparing search index...

    Class Page

    A full-page render request: validates the route, then calls Engine.renderPage.

    A page render returns a complete HTML Document for the first load. The route maps to a template under pages/ (see pageTemplate):

    1. / is pages/home.html; /article and /article/ are pages/article.html.
    2. If that template is not loaded, pages/index.html is used as the catch-all when it exists.
    3. Otherwise, or when the route is not a valid name (.., \, NUL), the render rejects with NOT_FOUND (Page not found). The route is never echoed into the error or the HTML.
    4. The page is bound with params. If layout/shell.html exists it is bound with the same params plus content set to the page HTML (the engine's content wins over a content param). Otherwise the page goes into a minimal default <!DOCTYPE html> document whose <body> holds a <dock-main> with an open shadow root.

    Routes only resolve under pages/: a route can never render a fragment or the layout. There is no route-parameter matching (/article/my-slug looks for pages/article/my-slug.html).

    Templates can use open Declarative Shadow DOM (<template shadowrootmode="open">) so shadow roots and scoped styles exist before any script runs; the engine does not add them to your templates (except in the default document).

    import { AnzaError, Page, htmlResponse } from '@anzaui/engine';

    try {
    const doc = await new Page('/article', { title: 'Deep Dive into STUI' }).run(engine);
    return htmlResponse(doc);
    } catch (err) {
    if (err instanceof AnzaError && err.code === 'NOT_FOUND') return new Response('Not Found', { status: 404 });
    throw err;
    }
    Index
    • Parameters

      • route: string

        The request path, e.g. / or /docs/intro.

      • Optionalparams: Params

        Values for the page and shell placeholders.

      Returns Page

    params?: Params

    Values for the page and shell placeholders.

    route: string

    The request path.