pub struct PageContext<'a> {Show 23 fields
pub title: &'a str,
pub description: &'a str,
pub slug: &'a str,
pub body_html: &'a str,
pub tree: &'a [TreeNode],
pub backlinks: &'a [Backlink],
pub headings: &'a [Heading],
pub commit: &'a str,
pub built: &'a str,
pub has_history: bool,
pub has_mermaid: bool,
pub has_math: bool,
pub base: &'a str,
pub site_title: &'a str,
pub search_enabled: bool,
pub has_diff: bool,
pub has_components_css: bool,
pub has_component_island: bool,
pub is_home: bool,
pub graph_json: &'a str,
pub graph_node_count: usize,
pub graph_edge_count: usize,
pub home: Option<HomeData<'a>>,
}Expand description
Everything a single page render needs.
Fields§
§title: &'a str§description: &'a strOptional frontmatter description:, rendered as the page header “lede”
under the title on doc pages. "" → no lede paragraph.
slug: &'a str§body_html: &'a str§tree: &'a [TreeNode]§backlinks: &'a [Backlink]Inbound references, rendered as cards in the right rail’s “Referenced by” section (this supersedes the old in-content backlinks block).
headings: &'a [Heading]The h2/h3 outline of this page, for the right-rail “On this page” TOC.
commit: &'a strShort commit hash for the rail’s “Additional info” → Commit row. "" →
the Commit row is omitted (no git repo / detached build).
built: &'a strBuild timestamp (YYYY-MM-DD HH:MM) for the “Built” row. "" → omitted.
has_history: boolWhether this doc has an emitted /<slug>/history/ page (drives the nav link).
has_mermaid: boolWhether this page contains a mermaid diagram (gates the mermaid island script).
has_math: boolWhether this page contains math (gates the KaTeX stylesheet <head> link).
base: &'a strDeployed base path (e.g. /docs); "" → no <base> tag (default).
site_title: &'a strSite title; "" → no "page — site" suffix (default).
search_enabled: boolWhether the search UI ships (gates the trigger + search.js).
has_diff: boolWhether the /diff/ workspace page exists (drives the topbar diff icon).
has_components_css: boolWhether any component shipped a style.css (links /components.css). The
component stylesheet is small + cacheable, so it links on every page when
present rather than per-page.
has_component_island: boolWhether this page used ≥1 component with an island.js (links
/components.js, gated per-page like the mermaid island).
is_home: boolWhether this page is the site home. Drives the home-only graph embed (the original surfaces the doc graph on the home page, not the sidebar).
graph_json: &'a strForce-layout graph JSON for the home embed (raw — render_page applies
the </ → <\/ escaping for the inline <script>). "" → no graph
block (not home, or the graph feature is off).
graph_node_count: usizeNode/edge counts for the home graph caption (ignored when graph_json is empty).
graph_edge_count: usize§home: Option<HomeData<'a>>Home dashboard payload (hero/stats/sections/recent). Some only for the
index doc; None everywhere else.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for PageContext<'a>
impl<'a> RefUnwindSafe for PageContext<'a>
impl<'a> Send for PageContext<'a>
impl<'a> Sync for PageContext<'a>
impl<'a> Unpin for PageContext<'a>
impl<'a> UnsafeUnpin for PageContext<'a>
impl<'a> UnwindSafe for PageContext<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more