Skip to content

Commit 482575f

Browse files
committed
Use html-root path for common files
1 parent 1d1cb23 commit 482575f

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/librustdoc/html/layout.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ r##"<!DOCTYPE html>
4848
4949
<title>{title}</title>
5050
51-
<link rel="stylesheet" type="text/css" href="../../{root_path}normalize{suffix}.css">
52-
<link rel="stylesheet" type="text/css" href="../../{root_path}rustdoc{suffix}.css"
51+
<link rel="stylesheet" type="text/css" href="/normalize{suffix}.css">
52+
<link rel="stylesheet" type="text/css" href="/rustdoc{suffix}.css"
5353
id="mainThemeStyle">
5454
{themes}
55-
<link rel="stylesheet" type="text/css" href="../../{root_path}dark{suffix}.css">
56-
<link rel="stylesheet" type="text/css" href="../../{root_path}main{suffix}.css" id="themeStyle">
57-
<script src="../../{root_path}storage{suffix}.js"></script>
55+
<link rel="stylesheet" type="text/css" href="/dark{suffix}.css">
56+
<link rel="stylesheet" type="text/css" href="/main{suffix}.css" id="themeStyle">
57+
<script src="/storage{suffix}.js"></script>
5858
{css_extension}
5959
6060
{favicon}
@@ -78,11 +78,11 @@ r##"<!DOCTYPE html>
7878
7979
<div class="theme-picker">
8080
<button id="theme-picker" aria-label="Pick another theme!">
81-
<img src="../../{root_path}brush{suffix}.svg" width="18" alt="Pick another theme!">
81+
<img src="/brush{suffix}.svg" width="18" alt="Pick another theme!">
8282
</button>
8383
<div id="theme-choices"></div>
8484
</div>
85-
<script src="../../{root_path}theme{suffix}.js"></script>
85+
<script src="/theme{suffix}.js"></script>
8686
<nav class="sub">
8787
<form class="search-form js-only">
8888
<div class="search-container">
@@ -155,12 +155,12 @@ r##"<!DOCTYPE html>
155155
window.rootPath = "{root_path}";
156156
window.currentCrate = "{krate}";
157157
</script>
158-
<script src="../../{root_path}main{suffix}.js"></script>
158+
<script src="/main{suffix}.js"></script>
159159
<script defer src="{root_path}search-index.js"></script>
160160
</body>
161161
</html>"##,
162162
css_extension = if css_file_extension {
163-
format!("<link rel=\"stylesheet\" type=\"text/css\" href=\"../../{root_path}theme{suffix}.css\">",
163+
format!("<link rel=\"stylesheet\" type=\"text/css\" href=\"/theme{suffix}.css\">",
164164
root_path = page.root_path,
165165
suffix=page.resource_suffix)
166166
} else {
@@ -193,7 +193,7 @@ r##"<!DOCTYPE html>
193193
themes = themes.iter()
194194
.filter_map(|t| t.file_stem())
195195
.filter_map(|t| t.to_str())
196-
.map(|t| format!(r#"<link rel="stylesheet" type="text/css" href="../../{}{}">"#,
196+
.map(|t| format!(r#"<link rel="stylesheet" type="text/css" href="/{}{}">"#,
197197
page.root_path,
198198
t.replace(".css", &format!("{}.css", page.resource_suffix))))
199199
.collect::<String>(),

0 commit comments

Comments
 (0)