Plombir::Renderer::Page
Composes one page: Markdown HTML plus a layout source.
Constants
Maximum layout nesting (post inside default inside …).
Chains this deep are always a cycle — see LayoutChainTooDeep.
Class methods
Returns sorted layout names (default, post, …) for layouts_dir.
Page.available_layouts("layouts") # => ["default", "post"]
Loads every components/*.html body as a component source
(basename → body without frontmatter), mirroring
partial_sources. Callers rendering many pages build this
once and pass it to render_file.
Page.component_sources("components") # => {"PostCard" => "<article>…"}
Loads every layouts/*.html body as an includable partial
(basename → body without frontmatter). A layout's layout:
parent is ignored here — includes inline the raw body only.
Callers rendering many pages build this once and pass it to
render_file instead of re-reading the directory per page.
Page.partial_sources("layouts") # => {"header" => "<header>…"}
Renders body_html inside layout_source.
vars holds page fields (title, description, date, …) and any
site.* keys. Every top-level key is also visible as page.<key>,
and content / page.content always hold body_html. assets
is the fingerprinted-asset manifest for | asset_url.
Page.render("<p>Hi.</p>", "<h1>{{ title }}</h1>{{ content }}", {"title" => "Hi"})
Loads layouts/<layout_name>.html from layouts_dir and renders it.
A layout with a frontmatter layout: parent renders inside that
parent first (its {{ content }} receives this layout's output),
up to MAX_CHAIN_DEPTH. Raises LayoutNotFound listing
available_layouts when a link in the chain is absent.
Page.render_file("<p>Hi.</p>", "post", "layouts", {"title" => "Hi"}, "content/a.md")