Correctly handle crate level page on docs.rs as well

This commit is contained in:
Guillaume Gomez 2022-07-13 14:43:52 +02:00
parent b3f4c31199
commit b98fb490b8
2 changed files with 15 additions and 18 deletions

View File

@ -479,8 +479,6 @@ function loadCss(cssFileName) {
}
if (sidebar) {
const isModule = hasClass(document.body, "mod");
if (!isModule) {
block("primitive", "primitives", "Primitive Types");
block("mod", "modules", "Modules");
block("macro", "macros", "Macros");
@ -497,7 +495,6 @@ function loadCss(cssFileName) {
block("traitalias", "trait-aliases", "Trait Aliases");
}
}
}
window.register_implementors = imp => {
const implementors = document.getElementById("implementors-list");

View File

@ -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.contains("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> {#- -#}