diff options
| author | bors <bors@rust-lang.org> | 2013-09-23 00:20:51 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-09-23 00:20:51 -0700 |
| commit | 80e096830dc4bd291597c904078fb0e60a09b2ec (patch) | |
| tree | 2f99a24f55a9854dcf07be90b204ee433de9c6ff /src | |
| parent | 03e5e9631567904e03ec61b698a1eeff1372125d (diff) | |
| parent | 83499d1a89ef4e38a0cd0fc02316539a836e24a2 (diff) | |
| download | rust-80e096830dc4bd291597c904078fb0e60a09b2ec.tar.gz rust-80e096830dc4bd291597c904078fb0e60a09b2ec.zip | |
auto merge of #9422 : alexcrichton/rust/fix-link, r=thestinger
This makes clicking on the logo do what you'd expect.
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/html/layout.rs | 8 | ||||
| -rw-r--r-- | src/librustdoc/html/render.rs | 19 |
2 files changed, 11 insertions, 16 deletions
diff --git a/src/librustdoc/html/layout.rs b/src/librustdoc/html/layout.rs index fcf13779389..718bacc24fd 100644 --- a/src/librustdoc/html/layout.rs +++ b/src/librustdoc/html/layout.rs @@ -36,7 +36,7 @@ pub fn render<T: fmt::Default, S: fmt::Default>( <link href='http://fonts.googleapis.com/css?family=Oswald:700|Inconsolata:400' rel='stylesheet' type='text/css'> - <link rel=\"stylesheet\" type=\"text/css\" href=\"{root_path}main.css\"> + <link rel=\"stylesheet\" type=\"text/css\" href=\"{root_path}{crate}/main.css\"> {favicon, select, none{} other{ <link rel=\"icon\" href=\"#\" sizes=\"16x16\" @@ -52,7 +52,7 @@ pub fn render<T: fmt::Default, S: fmt::Default>( <section class=\"sidebar\"> {logo, select, none{} other{ - <a href='{root_path}index.html'><img src='#' alt=''/></a> + <a href='{root_path}{crate}/index.html'><img src='#' alt=''/></a> }} {sidebar} @@ -73,9 +73,9 @@ pub fn render<T: fmt::Default, S: fmt::Default>( <script> var rootPath = \"{root_path}\"; </script> - <script src=\"{root_path}jquery.js\"></script> + <script src=\"{root_path}{crate}/jquery.js\"></script> <script src=\"{root_path}{crate}/search-index.js\"></script> - <script src=\"{root_path}main.js\"></script> + <script src=\"{root_path}{crate}/main.js\"></script> <div id=\"help\" class=\"hidden\"> <div class=\"shortcuts\"> diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index b004061e04a..464a4e4b736 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -128,20 +128,15 @@ pub fn run(mut crate: clean::Crate, dst: Path) { crate = cache.fold_crate(crate); // Add all the static files - write(cx.dst.push("jquery.js"), include_str!("static/jquery-2.0.3.min.js")); - write(cx.dst.push("main.js"), include_str!("static/main.js")); - write(cx.dst.push("main.css"), include_str!("static/main.css")); - write(cx.dst.push("normalize.css"), include_str!("static/normalize.css")); - write(cx.dst.push("index.html"), format!(" - <DOCTYPE html><html><head> - <meta http-equiv='refresh' - content=\"0; url={}/index.html\"> - </head><body></body></html> - ", crate.name)); + let dst = cx.dst.push(crate.name); + mkdir(&dst); + write(dst.push("jquery.js"), include_str!("static/jquery-2.0.3.min.js")); + write(dst.push("main.js"), include_str!("static/main.js")); + write(dst.push("main.css"), include_str!("static/main.css")); + write(dst.push("normalize.css"), include_str!("static/normalize.css")); { - mkdir(&cx.dst.push(crate.name)); - let dst = cx.dst.push(crate.name).push("search-index.js"); + let dst = dst.push("search-index.js"); let mut w = BufferedWriter::new(dst.open_writer(io::CreateOrTruncate)); let w = &mut w as &mut io::Writer; write!(w, "var searchIndex = ["); |
