File tree 2 files changed +20
-0
lines changed
crates/rari-doc/src/pages
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -296,6 +296,7 @@ pub struct JsonBasicSPA {
296
296
pub page_description : Option < & ' static str > ,
297
297
pub only_follow : bool ,
298
298
pub no_indexing : bool ,
299
+ pub page_not_found : bool ,
299
300
pub url : String ,
300
301
}
301
302
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ pub struct BasicSPA {
33
33
pub enum SPAData {
34
34
BlogIndex ,
35
35
HomePage ,
36
+ NotFound ,
36
37
BasicSPA ( BasicSPA ) ,
37
38
}
38
39
@@ -138,6 +139,16 @@ impl SPA {
138
139
page_description : self . page_description ,
139
140
only_follow : basic_spa. only_follow ,
140
141
no_indexing : basic_spa. no_indexing ,
142
+ page_not_found : false ,
143
+ url : concat_strs ! ( self . base_slug. as_ref( ) , self . slug) ,
144
+ } ) ) ) ,
145
+ SPAData :: NotFound => Ok ( BuiltDocy :: BasicSPA ( Box :: new ( JsonBasicSPA {
146
+ slug : self . slug ,
147
+ page_title : self . page_title ,
148
+ page_description : self . page_description ,
149
+ only_follow : false ,
150
+ no_indexing : true ,
151
+ page_not_found : true ,
141
152
url : concat_strs ! ( self . base_slug. as_ref( ) , self . slug) ,
142
153
} ) ) ) ,
143
154
SPAData :: HomePage => Ok ( BuiltDocy :: HomePageSPA ( Box :: new ( JsonHomePageSPA {
@@ -281,6 +292,14 @@ static BASIC_SPAS: Map<&'static str, BuildSPA> = phf_map!(
281
292
data: SPAData :: HomePage ,
282
293
..DEFAULT_BASIC_SPA
283
294
} ,
295
+ "404" => BuildSPA {
296
+ slug: "404" ,
297
+ page_title: "404" ,
298
+ page_description: None ,
299
+ trailing_slash: false ,
300
+ en_us_only: true ,
301
+ data: SPAData :: NotFound
302
+ } ,
284
303
"blog" => BuildSPA {
285
304
slug: "blog" ,
286
305
page_title: "MDN Blog" ,
You can’t perform that action at this time.
0 commit comments