pub fn register_early_global_fns(site: &mut Site) {
    site.tera.register_filter("markdown", filters::MarkdownFilter::new(site.config.clone()));

    site.tera.register_function(
        "get_url",
        global_fns::GetUrl::new(
            site.config.clone(),
            site.permalinks.clone(),
            vec![site.static_path.clone(), site.output_path.clone(), site.content_path.clone()],
        ),
    );
    site.tera
        .register_function("resize_image", global_fns::ResizeImage::new(site.imageproc.clone()));
    site.tera.register_function(
        "get_image_metadata",
        global_fns::GetImageMeta::new(site.content_path.clone()),
    );
    site.tera.register_function("load_data", global_fns::LoadData::new(site.base_path.clone()));
    site.tera.register_function("trans", global_fns::Trans::new(site.config.clone()));
    site.tera.register_function(
        "get_taxonomy_url",
        global_fns::GetTaxonomyUrl::new(
            &site.config.default_language,
            &site.taxonomies,
            site.config.slugify.taxonomies,
        ),
    );
    site.tera.register_function(
        "get_file_hash",
        global_fns::GetFileHash::new(vec![
            site.static_path.clone(),
            site.output_path.clone(),
            site.content_path.clone(),
        ]),
    );
}
/// Adds global fns that are to be available to shortcodes while rendering markdown
Adds global fns that are to be available to shortcodes while rendering markdown
Adds global fns that are to be available to shortcodes while rendering markdown
pub fn register_early_global_fns(site: &mut Site) {
    site.tera.register_filter("markdown", filters::MarkdownFilter::new(site.config.clone()));
    site.tera.register_function(
        "get_url",
        global_fns::GetUrl::new(
            site.config.clone(),
            site.permalinks.clone(),
            vec![site.static_path.clone(), site.output_path.clone(), site.content_path.clone()],
        ),
    );
    site.tera
        .register_function("resize_image", global_fns::ResizeImage::new(site.imageproc.clone()));
    site.tera.register_function(
        "get_image_metadata",
        global_fns::GetImageMeta::new(site.content_path.clone()),
    );
    site.tera.register_function("load_data", global_fns::LoadData::new(site.base_path.clone()));
    site.tera.register_function("trans", global_fns::Trans::new(site.config.clone()));
    site.tera.register_function(
        "get_taxonomy_url",
        global_fns::GetTaxonomyUrl::new(
            &site.config.default_language,
            &site.taxonomies,
            site.config.slugify.taxonomies,
        ),
    );
    site.tera.register_function(
        "get_file_hash",
        global_fns::GetFileHash::new(vec![
            site.static_path.clone(),
            site.output_path.clone(),
            site.content_path.clone(),
        ]),
    );
}
pub fn register_early_global_fns ( site : & mut Site ) { site . tera . register_filter ( " " , filters :: MarkdownFilter :: new ( site . config . clone ( ) ) ) ; site . tera . register_function ( " " , global_fns :: GetUrl :: new ( site . config . clone ( ) , site . permalinks . clone ( ) , vec ! [ site static_path clone ( ) site output_path clone ( ) site content_path clone ( ) ] , ) , ) ; site . tera . register_function ( " " , global_fns :: ResizeImage :: new ( site . imageproc . clone ( ) ) ) ; site . tera . register_function ( " " , global_fns :: GetImageMeta :: new ( site . content_path . clone ( ) ) , ) ; site . tera . register_function ( " " , global_fns :: LoadData :: new ( site . base_path . clone ( ) ) ) ; site . tera . register_function ( " " , global_fns :: Trans :: new ( site . config . clone ( ) ) ) ; site . tera . register_function ( " " , global_fns :: GetTaxonomyUrl :: new ( & site . config . default_language , & site . taxonomies , site . config . slugify . taxonomies , ) , ) ; site . tera . register_function ( " " , global_fns :: GetFileHash :: new ( vec ! [ site static_path clone ( ) site output_path clone ( ) site content_path clone ( ) ] ) , ) ; }
Adds global fns that are to be available to shortcodes while rendering markdown
Adds global fns that are to be available to shortcodes while rendering markdown
site
&mut Site