/// Create new App Data object using the global static config.
Create new App Data object using the global static config.
Create new App Data object using the global static config .
fn new() -> Self {
        // Register handlebars templates
        let mut template_registry = Handlebars::new();
        template_registry
            .register_templates_directory(".hbs", "templates")
            .map_err(|e| {
                error!("Failed to properly register handlebars templates: {}", e);
                e
            })
            .unwrap();
        // We do not use handlebars strict mode anymore since it increasingly breaks templates
        // without warning.
        // template_registry.set_strict_mode(true);
        // Register the helpers defined in the helpers module.
        register_helpers(&mut template_registry);
        info!("Handlebars templates registered.");
        Self {
            template_registry: Arc::new(template_registry),
        }
    }
fn new ( ) -> Self { // Register handlebars templates let mut template_registry = Handlebars :: new ( ) ; template_registry . register_templates_directory ( " " , " " ) . map_err ( | e | { error ! ( " " e ) ; e } ) . unwrap ( ) ; // We do not use handlebars strict mode anymore since it increasingly breaks templates // without warning. // template_registry.set_strict_mode(true); // Register the helpers defined in the helpers module. register_helpers ( & mut template_registry ) ; info ! ( " " ) ; Self { template_registry : Arc :: new ( template_registry ) , } }
Create new App Data object using the global static config.
Create new App Data object using the global static config .