Re-enabled compiling templates from bin.rs.
This commit is contained in:
parent
f1ec0ffb9e
commit
6bde22b667
26
src/bin.rs
26
src/bin.rs
@ -39,18 +39,20 @@ fn main() {
|
||||
(p.to_string(), template_content)
|
||||
})
|
||||
.collect();
|
||||
// let compiled_templates: Vec<CompiledTemplate> = template_contents
|
||||
// .iter()
|
||||
// .map(|(p, contents)| template_from_file(p, contents))
|
||||
// .collect();
|
||||
// let mut dust_renderer = DustRenderer::new();
|
||||
// compiled_templates.iter().for_each(|template| {
|
||||
// dust_renderer.load_source(template);
|
||||
// });
|
||||
// let main_template_name = &compiled_templates
|
||||
// .first()
|
||||
// .expect("There should be more than 1 template")
|
||||
// .name;
|
||||
let compiled_templates_result: Result<Vec<(String, Template)>, CompileError> =
|
||||
template_contents
|
||||
.iter()
|
||||
.map(|(p, contents)| template_from_file(p, contents))
|
||||
.collect();
|
||||
let compiled_templates = compiled_templates_result.unwrap();
|
||||
let main_template_name = &compiled_templates
|
||||
.first()
|
||||
.expect("There should be more than 1 template")
|
||||
.0;
|
||||
let mut dust_renderer = DustRenderer::new();
|
||||
compiled_templates.iter().for_each(|(name, template)| {
|
||||
dust_renderer.load_source(template, name.to_owned());
|
||||
});
|
||||
// let breadcrumbs = vec![&context as &dyn IntoContextElement];
|
||||
// println!(
|
||||
// "{}",
|
||||
|
Loading…
x
Reference in New Issue
Block a user