@@ -48,11 +48,11 @@ pub static STATIC_FILES_REDIRECTS: &[(&str, &str)] = &[
48
48
// Pre-2018 whitepaper locations
49
49
(
50
50
"pdfs/Rust-npm-Whitepaper.pdf" ,
51
- "/ static/pdfs/Rust-npm-Whitepaper.pdf" ,
51
+ "static/pdfs/Rust-npm-Whitepaper.pdf" ,
52
52
) ,
53
53
(
54
54
"pdfs/Rust-Tilde-Whitepaper.pdf" ,
55
- "/ static/pdfs/Rust-Tilde-Whitepaper.pdf" ,
55
+ "static/pdfs/Rust-Tilde-Whitepaper.pdf" ,
56
56
) ,
57
57
] ;
58
58
@@ -83,9 +83,11 @@ static PRE_2018_LOCALES: &[&str] = &[
83
83
84
84
pub fn create_redirects ( ctx : & RenderCtx ) -> anyhow:: Result < ( ) > {
85
85
// Static file redirects, no need to support languages
86
- // for (src, dst) in STATIC_FILES_REDIRECTS {
87
- // render_redirect(ctx, src, dst)?;
88
- // }
86
+ // We cannot really make non-HTML redirects easily, so we just duplicate the file contents
87
+ // under both paths.
88
+ for ( src, dst) in STATIC_FILES_REDIRECTS {
89
+ ctx. copy_asset_file ( dst, src) ?;
90
+ }
89
91
90
92
// if let Some((_, dest)) = STATIC_FILES_REDIRECTS.iter().find(|(src, _)| src == &path) {
91
93
// return Some(Redirect::permanent(*dest));
0 commit comments