Skip to content

Commit

Permalink
Rename welcome.md to index.md (#1039)
Browse files Browse the repository at this point in the history
When building the book, mdBook will always generate an `index.html`
page for first page of the book. This meant that we had the same
content available under two different names:

- `welcome.html`: this is what the TOC would link to, and
- `index.html` or simply `/`: this is what search engines link to

Renaming the page and setting up a redirect should fix this confusion.
We still don’t have a good way of avoiding links to the `index.html`
page, but this should fix the first half of the problem.

I tested this for translations as well by building the output in a
subdirectory and serving the parent directory.

Part of #847.
  • Loading branch information
mgeisler authored Jul 28, 2023
1 parent 98be9e1 commit 8d9fddd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ line-numbers = true
"unsafe/unsafe-functions.html" = "calling-unsafe-functions.html"
"welcome-bare-metal.html" = "bare-metal.html"
"welcome-day-4.html" = "concurrency.html"
# Send people to canonical URL instead of index.html
"welcome.html" = "./"

[output.exerciser]
output-directory = "comprehensive-rust-exercises"
3 changes: 2 additions & 1 deletion src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Summary

[Welcome to Comprehensive Rust 🦀](welcome.md)
<!-- Keep first page as index.md to avoid giving it two names. -->
[Welcome to Comprehensive Rust 🦀](index.md)
- [Running the Course](running-the-course.md)
- [Course Structure](running-the-course/course-structure.md)
- [Keyboard Shortcuts](running-the-course/keyboard-shortcuts.md)
Expand Down
File renamed without changes.

0 comments on commit 8d9fddd

Please sign in to comment.