pub struct PageConfig<'a> {
pub title: &'a str,
pub route_pattern: &'a str,
pub manifest: &'a AssetManifest,
pub config_json: Option<&'a Value>,
pub body_class: Option<&'a str>,
pub personality_css: Option<&'a str>,
pub body_prefix: Option<&'a RawHtml>,
}Expand description
Document metadata for an explicitly browser-rendered page.
Server-rendered pages use a bound crate::PageHandle.
Fields§
§title: &'a strText for the page’s <title>, HTML-escaped on the way out.
route_pattern: &'a strThe route this page was matched by, used to look up its assets in the
manifest (e.g. /users/:id).
manifest: &'a AssetManifestBuild manifest naming the content-hashed JS/CSS/font/IR files.
config_json: Option<&'a Value>Optional server data to expose to the client as
window.__FORMA_CONFIG__.
This is the safe path: the value is serialized by serde_json with
every < escaped, which cannot be misused no matter what the data
contains. Application code belongs in the page bundle.
body_class: Option<&'a str>Optional class attribute for <body>, HTML-escaped.
personality_css: Option<&'a str>Optional inline <style> for personality/theme overrides.
Emitted inside a <style> element. </ is neutralized (as a CSS
escape, losslessly) so the value cannot break out; everything else is
passed through as CSS.
body_prefix: Option<&'a RawHtml>Optional extra HTML before <div id="app">.
RAW, TRUSTED HTML. Interpolated verbatim with no escaping — that is the point of the field (callers use it to emit their own markup, such as a hand-written shell or a logo). Never build it from untrusted data.
Construct reviewed markup with RawHtml::trusted
and borrow it here. Plain strings do not satisfy this field’s type.
What is not the application’s own markup has a typed home instead:
modulepreload links come from the build’s manifest
(RenderCtx::with_module_preloads),
head links from RenderCtx::with_head_link,
and data from PageConfig::config_json.