Skip to content

Commit dc72834

Browse files
committed
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
2 parents 4e14ef0 + 5f5a84a commit dc72834

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rustbook/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ fn write_toc(book: &Book, current_page: &BookItem, out: &mut Write) -> io::Resul
5959

6060
try!(writeln!(out, "<li><a {} href='{}'><b>{}</b> {}</a>",
6161
class_string,
62-
item.path_to_root.join(&item.path.with_extension("html")).display(),
62+
current_page.path_to_root.join(&item.path).with_extension("html").display(),
6363
section,
6464
item.title));
6565
if !item.children.is_empty() {

0 commit comments

Comments
 (0)