Skip to content

Commit 80e0968

Browse files
committed
auto merge of #9422 : alexcrichton/rust/fix-link, r=thestinger
This makes clicking on the logo do what you'd expect.
2 parents 03e5e96 + 83499d1 commit 80e0968

File tree

3 files changed

+13
-17
lines changed

3 files changed

+13
-17
lines changed

Diff for: mk/tools.mk

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ RUSTPKG_INPUTS := $(wildcard $(S)src/librustpkg/*.rs)
2121

2222
# Rustdoc, the documentation tool
2323
RUSTDOC_LIB := $(S)src/librustdoc/rustdoc.rs
24-
RUSTDOC_INPUTS := $(wildcard $(S)src/librustdoc/*.rs)
24+
RUSTDOC_INPUTS := $(wildcard $(addprefix $(S)src/librustdoc/, \
25+
*.rs */*.rs */*/*.rs))
2526

2627
# Rusti, the JIT REPL
2728
RUSTI_LIB := $(S)src/librusti/rusti.rs

Diff for: src/librustdoc/html/layout.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub fn render<T: fmt::Default, S: fmt::Default>(
3636
3737
<link href='http://fonts.googleapis.com/css?family=Oswald:700|Inconsolata:400'
3838
rel='stylesheet' type='text/css'>
39-
<link rel=\"stylesheet\" type=\"text/css\" href=\"{root_path}main.css\">
39+
<link rel=\"stylesheet\" type=\"text/css\" href=\"{root_path}{crate}/main.css\">
4040
4141
{favicon, select, none{} other{
4242
<link rel=\"icon\" href=\"#\" sizes=\"16x16\"
@@ -52,7 +52,7 @@ pub fn render<T: fmt::Default, S: fmt::Default>(
5252
5353
<section class=\"sidebar\">
5454
{logo, select, none{} other{
55-
<a href='{root_path}index.html'><img src='#' alt=''/></a>
55+
<a href='{root_path}{crate}/index.html'><img src='#' alt=''/></a>
5656
}}
5757
5858
{sidebar}
@@ -73,9 +73,9 @@ pub fn render<T: fmt::Default, S: fmt::Default>(
7373
<script>
7474
var rootPath = \"{root_path}\";
7575
</script>
76-
<script src=\"{root_path}jquery.js\"></script>
76+
<script src=\"{root_path}{crate}/jquery.js\"></script>
7777
<script src=\"{root_path}{crate}/search-index.js\"></script>
78-
<script src=\"{root_path}main.js\"></script>
78+
<script src=\"{root_path}{crate}/main.js\"></script>
7979
8080
<div id=\"help\" class=\"hidden\">
8181
<div class=\"shortcuts\">

Diff for: src/librustdoc/html/render.rs

+7-12
Original file line numberDiff line numberDiff line change
@@ -128,20 +128,15 @@ pub fn run(mut crate: clean::Crate, dst: Path) {
128128
crate = cache.fold_crate(crate);
129129

130130
// Add all the static files
131-
write(cx.dst.push("jquery.js"), include_str!("static/jquery-2.0.3.min.js"));
132-
write(cx.dst.push("main.js"), include_str!("static/main.js"));
133-
write(cx.dst.push("main.css"), include_str!("static/main.css"));
134-
write(cx.dst.push("normalize.css"), include_str!("static/normalize.css"));
135-
write(cx.dst.push("index.html"), format!("
136-
<DOCTYPE html><html><head>
137-
<meta http-equiv='refresh'
138-
content=\"0; url={}/index.html\">
139-
</head><body></body></html>
140-
", crate.name));
131+
let dst = cx.dst.push(crate.name);
132+
mkdir(&dst);
133+
write(dst.push("jquery.js"), include_str!("static/jquery-2.0.3.min.js"));
134+
write(dst.push("main.js"), include_str!("static/main.js"));
135+
write(dst.push("main.css"), include_str!("static/main.css"));
136+
write(dst.push("normalize.css"), include_str!("static/normalize.css"));
141137

142138
{
143-
mkdir(&cx.dst.push(crate.name));
144-
let dst = cx.dst.push(crate.name).push("search-index.js");
139+
let dst = dst.push("search-index.js");
145140
let mut w = BufferedWriter::new(dst.open_writer(io::CreateOrTruncate));
146141
let w = &mut w as &mut io::Writer;
147142
write!(w, "var searchIndex = [");

0 commit comments

Comments
 (0)