Only list crates on the crate page
This commit is contained in:
parent
e081cd48f4
commit
a2ba9ef1ff
3 changed files with 20 additions and 10 deletions
|
|
@ -200,8 +200,15 @@ impl<'tcx> Context<'tcx> {
|
|||
)
|
||||
};
|
||||
let keywords = make_item_keywords(it);
|
||||
let name;
|
||||
let tyname_s = if it.is_crate() {
|
||||
name = format!("{} crate", tyname);
|
||||
name.as_str()
|
||||
} else {
|
||||
tyname.as_str()
|
||||
};
|
||||
let page = layout::Page {
|
||||
css_class: tyname.as_str(),
|
||||
css_class: tyname_s,
|
||||
root_path: &self.root_path(),
|
||||
static_root_path: self.shared.static_root_path.as_deref(),
|
||||
title: &title,
|
||||
|
|
|
|||
|
|
@ -565,9 +565,12 @@ function hideThemeButtonState() {
|
|||
window.initSidebarItems = function(items) {
|
||||
var sidebar = document.getElementsByClassName("sidebar-elems")[0];
|
||||
var current = window.sidebarCurrent;
|
||||
var isModule = hasClass(document.body, "mod");
|
||||
|
||||
function addSidebarCrates(crates) {
|
||||
if (!hasClass(document.body, "crate")) {
|
||||
// We only want to list crates on the crate page.
|
||||
return;
|
||||
}
|
||||
// Draw a convenient sidebar of known crates if we have a listing
|
||||
var div = document.createElement("div");
|
||||
div.className = "block crate";
|
||||
|
|
@ -634,6 +637,7 @@ function hideThemeButtonState() {
|
|||
}
|
||||
|
||||
if (sidebar) {
|
||||
var isModule = hasClass(document.body, "mod");
|
||||
if (!isModule) {
|
||||
block("primitive", "Primitive Types");
|
||||
block("mod", "Modules");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue