Expand description

Internal utilities for working with the serving process. These will be useful for building integrations for hosting Perseus on different platforms.

Structs

The properties required to get data for a page.

The shell used to interpolate the Perseus app into, including associated scripts and content defined by the user, components of the Perseus core, and plugins.

Represents the data necessary to render a page, including document metadata.

The options for setting up all server integrations. This should be literally constructed, as nothing is optional. If integrations need further properties, they should expose their own options in addition to these. These should be accessed through an Arc/Rc for integration developers.

The full set of properties that all server integrations take.

Functions

Prepares an HTMl error page for the client, with injected markers for hydration. In the event of an error, this should be returned to the client (with the appropriate status code) to allow Perseus to hydrate and display the correct error page. Note that this is only for use in initial loads (other systems handle errors in subsequent loads, and the app shell exists then so the server doesn’t have to do nearly as much work).

Gets the HTML/JSON data for the given page path. This will call SSG/SSR/etc., whatever is needed for that page. Note that HTML generated at request-time will always replace anything generated at build-time, incrementally, revalidated, etc.

Internal logic behind get_page. The only differences are that this takes a full template rather than just a template name, which can avoid an unnecessary lookup if you already know the template in full (e.g. initial load server-side routing). Because this handles templates with potentially revalidation and incremental generation, it uses both mutable and immutable stores.

Removes empty elements from a path, which is important due to double slashes. This returns a vector of the path’s components;

Gets the configuration of how to render each page using an immutable store.