pub fn render_html(&self, tera: &Tera, config: &Config, library: &Library) -> Result<String> {
        let tpl_name = match self.meta.template {
            Some(ref l) => l,
            None => "page.html",
        };

        let mut context = TeraContext::new();
        context.insert("config", config);
        context.insert("current_url", &self.permalink);
        context.insert("current_path", &self.path);
        context.insert("page", &self.to_serialized(library));
        context.insert("lang", &self.lang);

        render_template(&tpl_name, tera, context, &config.theme).map_err(|e| {
            Error::chain(format!("Failed to render page '{}'", self.file.path.display()), e)
        })
    }
/// Renders the page using the default layout, unless specified in front-matter
Renders the page using the default layout, unless specified in front-matter
Renders the page using the default layout unless specified in front - matter
pub fn render_html(&self, tera: &Tera, config: &Config, library: &Library) -> Result<String> {
        let tpl_name = match self.meta.template {
            Some(ref l) => l,
            None => "page.html",
        };
        let mut context = TeraContext::new();
        context.insert("config", config);
        context.insert("current_url", &self.permalink);
        context.insert("current_path", &self.path);
        context.insert("page", &self.to_serialized(library));
        context.insert("lang", &self.lang);
        render_template(&tpl_name, tera, context, &config.theme).map_err(|e| {
            Error::chain(format!("Failed to render page '{}'", self.file.path.display()), e)
        })
    }
pub fn render_html ( & self , tera : & Tera , config : & Config , library : & Library ) -> Result < String > { let tpl_name = match self . meta . template { Some ( ref l ) => l , None => " " , } ; let mut context = TeraContext :: new ( ) ; context . insert ( " " , config ) ; context . insert ( " " , & self . permalink ) ; context . insert ( " " , & self . path ) ; context . insert ( " " , & self . to_serialized ( library ) ) ; context . insert ( " " , & self . lang ) ; render_template ( & tpl_name , tera , context , & config . theme ) . map_err ( | e | { Error :: chain ( format ! ( " " self file path display ( ) ) , e ) } ) }
Renders the page using the default layout, unless specified in front-matter
Renders the page using the default layout unless specified in front - matter
&self
tera
&Tera
config
&Config
library
&Library