Skip to main content

render

Function render 

Source
pub fn render(
    template: &Path,
    source: &str,
    suffix: &str,
    context: &impl Serialize,
) -> Result<Served, ServeError>
Expand description

Render one template with context and read the file it declares.

template names the template, usually its path relative to the repository; its file name minus suffix is the default target name.

ยงErrors

When the file name does not end in suffix, the template does not parse or render, or its declarations do not fit the schema: a path outside the repository, a name that is not one file name, or a value of the wrong type.