-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correctly handle crate level page on docs.rs as well #99209
Conversation
Let's actually remove the JS check. Right now most of the logic for this is in our page template that decides which "extra" JS to include: https://github.com/rust-lang/rust/blob/master/src/librustdoc/html/templates/page.html#L37-L44 That is, For consistency with your intent from https://github.com/rust-lang/rust/pull/84834/files#r625337543, this should become: That is, |
@jsha You mean something like this? diff --git a/src/librustdoc/html/templates/page.html b/src/librustdoc/html/templates/page.html
index dfb3e4e6a2c..db45253ef69 100644
--- a/src/librustdoc/html/templates/page.html
+++ b/src/librustdoc/html/templates/page.html
@@ -39,7 +39,7 @@
{%- else if page.css_class == "source" -%}
<script defer src="{{static_root_path|safe}}source-script{{page.resource_suffix}}.js"></script> {#- -#}
<script defer src="{{page.root_path|safe}}source-files{{page.resource_suffix}}.js"></script> {#- -#}
- {%- else -%}
+ {%- else if page.css_class != "mod" -%}
<script defer src="sidebar-items{{page.resource_suffix}}.js"></script> {#- -#}
{%- endif -%}
<script defer src="{{static_root_path|safe}}main{{page.resource_suffix}}.js"></script> {#- -#} |
Yes, although that should be a |
17e7156
to
fcdd332
Compare
Less JS and less JS files loaded. That sounds like a big win. :) PS: updated! |
fcdd332
to
b98fb49
Compare
Updated with @jsha's suggestion. |
@bors r+ rollup |
Rollup of 5 pull requests Successful merges: - rust-lang#88991 (Add Nintendo Switch as tier 3 target) - rust-lang#98869 (Remove some usages of `guess_head_span`) - rust-lang#99119 (Refactor: remove a string matching about methods) - rust-lang#99209 (Correctly handle crate level page on docs.rs as well) - rust-lang#99246 (Update RLS) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fixes #99121.
On docs.rs, they move the
class
attribute into a child which still hasrustdoc
. So instead of using the<body>
, we can simply use this one directly.r? @jsha