Create a page header struct.

This commit is contained in:
Tom Alexander
2023-12-17 14:28:27 -05:00
parent 1ff41940a5
commit 35dbab0ceb
6 changed files with 34 additions and 6 deletions

View File

@@ -34,7 +34,7 @@ impl<'a> RendererIntegration<'a> for DusterRenderer<'a> {
}
// TODO: This is horribly inefficient. I am converting from a serialize type to json and back again so I can use the existing implementation of IntoContextElement. Honestly, I probably need to rework a lot of duster now that I've improved in rust over the years.
let json_context = serde_json::to_string(&context)?;
println!("{}", json_context);
// println!("{}", json_context);
let parsed_context: serde_json::Value = serde_json::from_str(json_context.as_str())?;
let rendered_output = dust_renderer.render("main", Some(&parsed_context))?;
Ok(rendered_output)