Module

x/lume/plugins/on_demand.ts>JsonRouterCollector

🔥 Static site generator for Deno 🦕
Very Popular
Latest
class JsonRouterCollector
import { JsonRouterCollector } from "https://dotland.deno.dev/x/lume@v2.4.2/plugins/on_demand.ts";

Class to load and manage static routes in a JSON file Used by default if no router is provided

Constructors

new
JsonRouterCollector(options: JsonRouterCollectorOptions)

Properties

options: JsonRouterCollectorOptions
routes: Map<string, string>

Pages that must be generated on demand

Methods

collectRoutes(pages: Page[]): void

Collect the routes of all pages with data.ondemand = true

saveRoutes(specifiers: string[]): Promise<void>

Save the routes into the routesFile