@@ -17,7 +17,7 @@ use crate::cobalt_model::slug;
17
17
use crate :: cobalt_model:: Minify ;
18
18
use crate :: error:: * ;
19
19
20
- pub struct RenderContex < ' a > {
20
+ pub struct RenderContext < ' a > {
21
21
pub parser : & ' a cobalt_model:: Liquid ,
22
22
pub markdown : & ' a cobalt_model:: Markdown ,
23
23
pub vimwiki : & ' a cobalt_model:: Vimwiki ,
@@ -26,12 +26,12 @@ pub struct RenderContex<'a> {
26
26
}
27
27
28
28
#[ cfg( not( feature = "html-minifier" ) ) ]
29
- fn minify_if_enabled ( html : String , _context : & RenderContex , _file_path : & Path ) -> Result < String > {
29
+ fn minify_if_enabled ( html : String , _context : & RenderContext , _file_path : & Path ) -> Result < String > {
30
30
Ok ( html)
31
31
}
32
32
33
33
#[ cfg( feature = "html-minifier" ) ]
34
- fn minify_if_enabled ( html : String , context : & RenderContex , file_path : & Path ) -> Result < String > {
34
+ fn minify_if_enabled ( html : String , context : & RenderContext , file_path : & Path ) -> Result < String > {
35
35
let extension = file_path. extension ( ) . unwrap_or_else ( Default :: default) ;
36
36
if context. minify . html && ( extension == "html" || extension == "htm" ) {
37
37
Ok ( html_minifier:: minify ( html) ?)
@@ -299,7 +299,7 @@ impl Document {
299
299
/// Takes `content` string and returns rendered HTML. This function doesn't
300
300
/// take `"extends"` attribute into account. This function can be used for
301
301
/// rendering content or excerpt.
302
- fn render_html ( & self , content : & str , context : & RenderContex ) -> Result < String > {
302
+ fn render_html ( & self , content : & str , context : & RenderContext ) -> Result < String > {
303
303
let html = if self . front . templated {
304
304
let template = context. parser . parse ( content) ?;
305
305
template. render ( context. globals ) ?
@@ -322,7 +322,7 @@ impl Document {
322
322
/// given, or extracted from the content, if `excerpt_separator` is not
323
323
/// empty. When neither condition applies, the excerpt is set to the `Nil`
324
324
/// value.
325
- pub fn render_excerpt ( & mut self , context : & RenderContex ) -> Result < ( ) > {
325
+ pub fn render_excerpt ( & mut self , context : & RenderContext ) -> Result < ( ) > {
326
326
let value = if let Some ( excerpt_str) = self . front . excerpt . as_ref ( ) {
327
327
let excerpt = self . render_html ( excerpt_str, context) ?;
328
328
Value :: scalar ( excerpt)
@@ -345,7 +345,7 @@ impl Document {
345
345
/// Renders the content and adds it to attributes of the document.
346
346
///
347
347
/// When we say "content" we mean only this document without extended layout.
348
- pub fn render_content ( & mut self , context : & RenderContex ) -> Result < ( ) > {
348
+ pub fn render_content ( & mut self , context : & RenderContext ) -> Result < ( ) > {
349
349
let content_html = self . render_html ( & self . content , context) ?;
350
350
self . attributes
351
351
. insert ( "content" . into ( ) , Value :: scalar ( content_html) ) ;
@@ -359,7 +359,7 @@ impl Document {
359
359
/// * layout may be inserted to layouts cache
360
360
pub fn render (
361
361
& mut self ,
362
- context : & RenderContex ,
362
+ context : & RenderContext ,
363
363
layouts : & HashMap < String , String > ,
364
364
) -> Result < String > {
365
365
if let Some ( ref layout) = self . front . layout {
0 commit comments