File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed
Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -34,17 +34,6 @@ pub struct Document {
3434}
3535
3636impl Document {
37- pub fn new ( content : & str ) -> Document {
38- Document {
39- path : PathBuf :: new ( ) ,
40- description : None ,
41- image : None ,
42- title : "404" . to_string ( ) ,
43- toc_links : Vec :: new ( ) ,
44- html : content. to_string ( ) ,
45- }
46- }
47-
4837 pub async fn from_path ( path : & PathBuf ) -> anyhow:: Result < Document , std:: io:: Error > {
4938 let contents = tokio:: fs:: read_to_string ( & path) . await ?;
5039
@@ -314,9 +303,9 @@ impl Collection {
314303 }
315304 // Return page not found on bad path
316305 _ => {
317- let mut layout = crate :: templates:: Layout :: new ( "404" , None ) ;
306+ let mut layout = crate :: templates:: Layout :: new ( "404" , Some ( cluster ) ) ;
318307
319- let doc = crate :: api :: cms :: Document :: new (
308+ let doc = String :: from (
320309 r#"
321310 <div style='height: 80vh'>
322311 <h2>Oops, document not found!</h2>
@@ -333,7 +322,7 @@ impl Collection {
333322 . nav_title ( & self . name )
334323 . footer ( cluster. context . marketing_footer . to_string ( ) ) ;
335324
336- layout. render ( crate :: templates:: Article { content : doc. html } ) ;
325+ layout. render ( crate :: templates:: Article { content : doc } ) ;
337326
338327 Err ( crate :: responses:: NotFound ( layout. into ( ) ) )
339328 }
You can’t perform that action at this time.
0 commit comments