Skip to main content

render_page

Function render_page 

Source
pub fn render_page(
    template: &str,
    loader_data_json: &str,
    config_json: &str,
    i18n_opts_json: Option<&str>,
) -> String
Expand description

Render a page: inject data into template, assemble __SEAM_DATA__ script, apply head metadata and locale attributes.

This is the single entry point that replaces ~60 lines of duplicated logic across TS, Rust, and Go backends.

Arguments are JSON strings for cross-language compatibility:

  • template: pre-resolved HTML template (layout chain already applied)
  • loader_data_json: {"key": value, ...} from all loaders (layout + page)
  • config_json: serialized PageConfig
  • i18n_opts_json: optional serialized I18nOpts