|
| 1 | +- Feature Name: N/A |
| 2 | +- Start Date: 2016-12-22 |
| 3 | +- RFC PR: |
| 4 | +- Rust Issue: |
| 5 | + |
| 6 | +# Summary |
| 7 | +[summary]: #summary |
| 8 | + |
| 9 | +Change doc.rust-lang.org to redirect to the latest release instead of an alias |
| 10 | +of stable. |
| 11 | + |
| 12 | +# Motivation |
| 13 | +[motivation]: #motivation |
| 14 | + |
| 15 | +Today, if you hit https://doc.rust-lang.org/, you'll see the same thing as if |
| 16 | +you hit https://doc.rust-lang.org/stable/. It does not redirect, but instead |
| 17 | +displays the same documentation. This is suboptimal for multiple reasons: |
| 18 | + |
| 19 | +* One of the oldest bugs open in Rust, from September 2013 (a four digit issue |
| 20 | + number!), is about the lack of `rel=canonical`, which means search results |
| 21 | + are being duplicated between `/` and `/stable`, at least ([issue link][9461]) |
| 22 | +* `/` not having any version info is a similar bug, stated in a different way, |
| 23 | + but still has the same problems. ([issue link][14466]) |
| 24 | +* We've attempted to change the URL structure of Rustdoc in the past, but it's |
| 25 | + caused many issues, which will be elaborated below. ([issue link][34271]) |
| 26 | + |
| 27 | +[9461]: http://github.com/rust-lang/rust/issues/9461 |
| 28 | +[14466]: https://github.com/rust-lang/rust/issues/14466 |
| 29 | +[34271]: https://github.com/rust-lang/rust/issues/34271 |
| 30 | + |
| 31 | +There's other issues that stem from this as well that haven't been filed as |
| 32 | +issues. Two notable examples are: |
| 33 | + |
| 34 | +* When we release the new book, links are going to break. This has multiple |
| 35 | + ways of being addressed, and so isn't a strong motivation, but fixing this |
| 36 | + issue would help out a lot. |
| 37 | +* In order to keep links working, we modified rustdoc [to add redirects from |
| 38 | + the older format](https://github.com/rust-lang/rust/issues/35020). But this |
| 39 | + can lead to degenerate situations in certain crates. `libc`, one of the most |
| 40 | + important crates in Rust, and included in the official docs, [had their docs |
| 41 | + break](https://github.com/rust-lang/libc/pull/438) because so many extra |
| 42 | + files were generated that GitHub Pages refused to serve them any more. |
| 43 | + |
| 44 | +From `#rust-internals` on 2016-12-22: |
| 45 | + |
| 46 | +```text |
| 47 | +18:19 <@brson> lots of libc docs |
| 48 | +18:19 <@steveklabnik> :( |
| 49 | +18:20 <@brson> 6k to document every C constant |
| 50 | +``` |
| 51 | + |
| 52 | +Short URLs are nice to have, but they have an increasing maintenance cost |
| 53 | +that's affecting other parts of the project in an adverse way. |
| 54 | + |
| 55 | +The big underlying issue here is that people tend to link to `/`, becuase it's |
| 56 | +what you get by defualt. By changing the default, people will link to the |
| 57 | +specific version instead. This means that their links will not break, and will |
| 58 | +allow us to update the URL structure of our documentation more freely. |
| 59 | + |
| 60 | +# Detailed design |
| 61 | +[design]: #detailed-design |
| 62 | + |
| 63 | +https://doc.rust-lang.org/ should issue a redirect to https://doc.rust-lang.org/RELEASE, |
| 64 | +where RELEASE is the latest stable release, like `1.14.0`. |
| 65 | + |
| 66 | +Part of the release process will be updating this redirect. |
| 67 | + |
| 68 | +# How We Teach This |
| 69 | +[how-we-teach-this]: #how-we-teach-this |
| 70 | + |
| 71 | +There's not a lot to teach; users end up on a different page than they used to. |
| 72 | + |
| 73 | +# Drawbacks |
| 74 | +[drawbacks]: #drawbacks |
| 75 | + |
| 76 | +Losing short URLs is a drawback. This is outweighed by other considerations, |
| 77 | +in my opinion, as the rest of the RFC shows. |
| 78 | + |
| 79 | +# Alternatives |
| 80 | +[alternatives]: #alternatives |
| 81 | + |
| 82 | +We could make no changes. We've dealt with all of these problems so far, so |
| 83 | +it's possible that we won't run into more issues in the future. |
| 84 | + |
| 85 | +We could do work on the `rel=canonical` issue instead, which would solve this |
| 86 | +in a different way. This doesn't totally solve all issues, however, only |
| 87 | +the duplication issue. |
| 88 | + |
| 89 | +# Unresolved questions |
| 90 | +[unresolved]: #unresolved-questions |
| 91 | + |
| 92 | +None. |
0 commit comments