Skip to main content

to_shell_page

Function to_shell_page 

Source
pub fn to_shell_page(
    shell: &SurfDoc,
    body_html: &str,
    config: &PageConfig,
) -> String
Expand description

Render a full HTML page from a site shell plus pre-rendered body HTML.

This is the site-shell entrypoint for consumers (e.g. cloudsurf.com) that keep a shared ::site/::nav/::footer shell in one .surf file and feed per-route content as already-rendered HTML. The <head> is built from config (favicons, stylesheets, scripts, FOUC theme init, OG/Twitter); the Block::Nav blocks in shell render before <main> (rich shell when their fields request it) and the Block::Footer blocks render after it. body_html is inserted verbatim inside <main class="surfdoc">.