Skip to content

Commit f3b348b

Browse files
committed
rustdoc: do not preload fonts when browsing locally
1 parent 6b1e5d9 commit f3b348b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/librustdoc/html/templates/page.html

+2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
<meta name="generator" content="rustdoc"> {# #}
77
<meta name="description" content="{{page.description}}"> {# #}
88
<title>{{page.title}}</title> {# #}
9+
<script> if (window.location.protocol !== "file:") document.write(` {# Hack to skip preloading fonts locally - see #98769 #}
910
<link rel="preload" as="font" type="font/woff2" crossorigin href="{{static_root_path|safe}}{{files.source_serif_4_regular}}"> {# #}
1011
<link rel="preload" as="font" type="font/woff2" crossorigin href="{{static_root_path|safe}}{{files.fira_sans_regular}}"> {# #}
1112
<link rel="preload" as="font" type="font/woff2" crossorigin href="{{static_root_path|safe}}{{files.fira_sans_medium}}"> {# #}
1213
<link rel="preload" as="font" type="font/woff2" crossorigin href="{{static_root_path|safe}}{{files.source_code_pro_regular}}"> {# #}
1314
<link rel="preload" as="font" type="font/woff2" crossorigin href="{{static_root_path|safe}}{{files.source_code_pro_semibold}}"> {# #}
15+
`)</script> {# #}
1416
<link rel="stylesheet" {#+ #}
1517
href="{{static_root_path|safe}}{{files.normalize_css}}"> {# #}
1618
<link rel="stylesheet" {#+ #}

0 commit comments

Comments
 (0)