pub async fn build_templates_for_locale(
    templates: &TemplateMap<SsrNode>,
    translator: &Translator,
    (immutable_store, mutable_store): (&ImmutableStore, &impl MutableStore),
    exporting: bool,
) -> Result<(), ServerError> {
    // The render configuration stores a list of pages to the root paths of their templates
    let mut render_cfg = HashMap::new();
    // Create each of the templates
    let mut futs = Vec::new();
    for template in templates.values() {
        futs.push(build_template_and_get_cfg(
            template,
            translator,
            (immutable_store, mutable_store),
            exporting,
        ));
    }
    let template_cfgs = try_join_all(futs).await?;
    for template_cfg in template_cfgs {
        render_cfg.extend(template_cfg.into_iter())
    }

    immutable_store
        .write(
            "render_conf.json",
            &serde_json::to_string(&render_cfg).unwrap(),
        )
        .await?;

    Ok(())
}
/// Runs the build process of building many different templates for a single locale. If you're not using i18n, provide a `Translator::empty()`
/// for this. You should only build the most commonly used locales here (the rest should be built on demand).
Runs the build process of building many different templates for a single locale. If you're not using i18n, provide a `Translator::empty()`
for this. You should only build the most commonly used locales here (the rest should be built on demand).
Runs the build process of building many different templates for a single locale . If you ' re not using i18n provide a ` Translator :: empty () ` for this . You should only build the most commonly used locales here ( the rest should be built on demand ) .
pub async fn build_templates_for_locale(
    templates: &TemplateMap<SsrNode>,
    translator: &Translator,
    (immutable_store, mutable_store): (&ImmutableStore, &impl MutableStore),
    exporting: bool,
) -> Result<(), ServerError> {
    // The render configuration stores a list of pages to the root paths of their templates
    let mut render_cfg = HashMap::new();
    // Create each of the templates
    let mut futs = Vec::new();
    for template in templates.values() {
        futs.push(build_template_and_get_cfg(
            template,
            translator,
            (immutable_store, mutable_store),
            exporting,
        ));
    }
    let template_cfgs = try_join_all(futs).await?;
    for template_cfg in template_cfgs {
        render_cfg.extend(template_cfg.into_iter())
    }
    immutable_store
        .write(
            "render_conf.json",
            &serde_json::to_string(&render_cfg).unwrap(),
        )
        .await?;
    Ok(())
}
pub async fn build_templates_for_locale ( templates : & TemplateMap < SsrNode > , translator : & Translator , ( immutable_store , mutable_store ) : ( & ImmutableStore , & impl MutableStore ) , exporting : bool , ) -> Result < ( ) , ServerError > { // The render configuration stores a list of pages to the root paths of their templates let mut render_cfg = HashMap :: new ( ) ; // Create each of the templates let mut futs = Vec :: new ( ) ; for template in templates . values ( ) { futs . push ( build_template_and_get_cfg ( template , translator , ( immutable_store , mutable_store ) , exporting , ) ) ; } let template_cfgs = try_join_all ( futs ) . await ? ; for template_cfg in template_cfgs { render_cfg . extend ( template_cfg . into_iter ( ) ) } immutable_store . write ( " " , & serde_json :: to_string ( & render_cfg ) . unwrap ( ) , ) . await ? ; Ok ( ( ) ) }
Runs the build process of building many different templates for a single locale.
Runs the build process of building many different templates for a single locale .
templates
&TemplateMap<SsrNode>
translator
(&ImmutableStore, &impl MutableStore)
exporting
bool
templates
&TemplateMap<SsrNode>
translator
(&ImmutableStore, &impl MutableStore)
exporting
bool