@@ -98,8 +98,7 @@ fn add_rust_attribute_on_codeblock(explanation: &str) -> String {
98
98
99
99
fn render_html ( output_path : & Path ) -> Result < ( ) , Box < dyn Error > > {
100
100
let mut introduction = format ! (
101
- "<script src='redirect.js'></script>
102
- # Rust error codes index
101
+ "# Rust error codes index
103
102
104
103
This page lists all the error codes emitted by the Rust compiler.
105
104
@@ -149,7 +148,12 @@ This page lists all the error codes emitted by the Rust compiler.
149
148
book. book . sections . push ( BookItem :: Chapter ( chapter) ) ;
150
149
book. build ( ) ?;
151
150
152
- // We can't put this content into another file, otherwise `mbdbook` will also put it into the
151
+ // The error-index used to be generated manually (without mdbook), and the
152
+ // index was located at the top level. Now that it is generated with
153
+ // mdbook, error-index.html has moved to error_codes/error-index.html.
154
+ // This adds a redirect so that old links go to the new location.
155
+ //
156
+ // We can't put this content into another file, otherwise `mdbook` will also put it into the
153
157
// output directory, making a duplicate.
154
158
fs:: write (
155
159
output_path. join ( "error-index.html" ) ,
@@ -163,7 +167,6 @@ This page lists all the error codes emitted by the Rust compiler.
163
167
</head>
164
168
<body>
165
169
<div>If you are not automatically redirected to the error code index, please <a id="index-link" href="./error_codes/error-index.html">here</a>.
166
- <script>document.getElementById("index-link").click()</script>
167
170
</body>
168
171
</html>"# ,
169
172
) ?;
0 commit comments