Content builders are how you set up custom pagetypes or override the rendering of existing pagetypes.
A custom page type with dynamic contents (ie affected by the user requesting the page) is defined in a siteprofile:
types:
pages.signup:
metaType: page
dynamicExecution:
contentBuilder: signup.ts#buildSignupPage
A stub contentBuilder implementation would look like this:
import type { ContentPageRequest, WebResponse } from "@webhare/router";
import { litty } from "@webhare/litty";
export async function renderRagTestPage(req: ContentPageRequest): Promise<WebResponse> {
const result = litty`<p>My dynamic page</p>`;
return req.buildWebPage(result);
}