Skip to content

Commit e44f9c5

Browse files
authored
Rollup merge of rust-lang#59992 - QuietMisdreavus:static-settings-path, r=GuillaumeGomez
rustdoc: use --static-root-path for settings.js At the time i was writing rust-lang/docs.rs#332, i noticed that the `settings.js` file that was being loaded was not being loaded from the `--static-root-path`. This PR fixes that so that users on docs.rs can effectively cache this file.
2 parents ee14801 + 1c0e1c1 commit e44f9c5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Diff for: src/librustdoc/html/render.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2113,7 +2113,8 @@ impl Context {
21132113
&final_file);
21142114

21152115
// Generating settings page.
2116-
let settings = Settings::new("./", &self.shared.resource_suffix);
2116+
let settings = Settings::new(self.shared.static_root_path.deref().unwrap_or("./"),
2117+
&self.shared.resource_suffix);
21172118
page.title = "Rustdoc settings";
21182119
page.description = "Settings of Rustdoc";
21192120
page.root_path = "./";

Diff for: src/test/rustdoc/static-root-path.rs

+4
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ pub struct SomeStruct;
1212
// @!matches - '"\.\./\.\./source-script\.js"'
1313
// @matches - '"\.\./\.\./source-files.js"'
1414
// @!matches - '"/cache/source-files\.js"'
15+
16+
// @has settings.html
17+
// @matches - '/cache/settings\.js'
18+
// @!matches - '\./settings\.js'

0 commit comments

Comments
 (0)