@@ -34,17 +34,6 @@ pub struct Document {
34
34
}
35
35
36
36
impl 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
-
48
37
pub async fn from_path ( path : & PathBuf ) -> anyhow:: Result < Document , std:: io:: Error > {
49
38
let contents = tokio:: fs:: read_to_string ( & path) . await ?;
50
39
@@ -314,9 +303,9 @@ impl Collection {
314
303
}
315
304
// Return page not found on bad path
316
305
_ =>{
317
- let mut layout =crate :: templates:: Layout :: new ( "404" , None ) ;
306
+ let mut layout =crate :: templates:: Layout :: new ( "404" , Some ( cluster ) ) ;
318
307
319
- let doc =crate :: api :: cms :: Document :: new (
308
+ let doc =String :: from (
320
309
r#"
321
310
<div style='height: 80vh'>
322
311
<h2>Oops, document not found!</h2>
@@ -333,7 +322,7 @@ impl Collection {
333
322
. nav_title ( & self . name )
334
323
. footer ( cluster. context . marketing_footer . to_string ( ) ) ;
335
324
336
- layout. render ( crate :: templates:: Article { content : doc. html } ) ;
325
+ layout. render ( crate :: templates:: Article { content : doc} ) ;
337
326
338
327
Err ( crate :: responses:: NotFound ( layout. into ( ) ) )
339
328
}