about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-06-08 19:18:31 +0000
committerbors <bors@rust-lang.org>2015-06-08 19:18:31 +0000
commitdc72834e2b482e904352fb3442e0450ee0d53190 (patch)
tree4705f395b24667e7bb04fc7d80f5e09b0964cdb0
parent4e14ef0516b09bd33020a962aa47cf714def5aff (diff)
parent5f5a84a59c38f8b8bfd9984917690f6db25a3aff (diff)
downloadrust-dc72834e2b482e904352fb3442e0450ee0d53190.tar.gz
rust-dc72834e2b482e904352fb3442e0450ee0d53190.zip
Auto merge of #26060 - funkill:fix_rustbook, r=alexcrichton
Case: 
Russian translate of trpl use this structure:
```bash
rust_book_ru $ tree
.
├── README.md
├── src
│   ├── academic-research.md
...
└── SUMMARY.md
```
Links in table of content generated relative to the root dir, for example if i'm on the page `http://kgv.github.io/rust_book_ru/src/academic-research.html` link to README.html will be `http://kgv.github.io/rust_book_ru/src/README.html`, not `http://kgv.github.io/rust_book_ru/README.html`.
Now we use old version of rustbook.
Sorry for my english
-rw-r--r--src/rustbook/build.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rustbook/build.rs b/src/rustbook/build.rs
index 31c973214a1..5ffb9b007d0 100644
--- a/src/rustbook/build.rs
+++ b/src/rustbook/build.rs
@@ -59,7 +59,7 @@ fn write_toc(book: &Book, current_page: &BookItem, out: &mut Write) -> io::Resul
 
         try!(writeln!(out, "<li><a {} href='{}'><b>{}</b> {}</a>",
                  class_string,
-                 item.path_to_root.join(&item.path.with_extension("html")).display(),
+                 current_page.path_to_root.join(&item.path).with_extension("html").display(),
                  section,
                  item.title));
         if !item.children.is_empty() {