Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Go to Latest
class PageGenerator
import { PageGenerator } from "https://deno.land/x/frugal@0.2.1/packages/core/PageGenerator.ts";

Class handling the page generation process.

Constructors

new
PageGenerator(page: Page<PATH, DATA, BODY>, config: PageGeneratorConfig)

Type Parameters

optional
PATH extends Record<string, string> = Record<string, string>
optional
DATA = unknown
optional
BODY = unknown

Methods

generate(request: GenerationRequest<BODY>): Promise<{ pagePath: string; content: string; headers: Headers; }>

Generate the page given a request object.

Will throw if the request pathname does not match the page pattern.

generateContentFromData(pathname: string, unnamed 1: ContentGenerationContext<DATA, PATH>): Promise<{ pagePath: string; content: string; }>

Generate the content of a page form its data and path