Rollup merge of #107482 - notriddle:notriddle/keywords, r=jsha
rustdoc: remove meta keywords from HTML Discussed in <https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/.60.3Cmeta.20name.3D.22keywords.22.3E.60>
This commit is contained in:
commit
e776a63956
@ -30,7 +30,6 @@ pub(crate) struct Page<'a> {
|
|||||||
pub(crate) root_path: &'a str,
|
pub(crate) root_path: &'a str,
|
||||||
pub(crate) static_root_path: Option<&'a str>,
|
pub(crate) static_root_path: Option<&'a str>,
|
||||||
pub(crate) description: &'a str,
|
pub(crate) description: &'a str,
|
||||||
pub(crate) keywords: &'a str,
|
|
||||||
pub(crate) resource_suffix: &'a str,
|
pub(crate) resource_suffix: &'a str,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
use super::write_shared::write_shared;
|
use super::write_shared::write_shared;
|
||||||
use super::{
|
use super::{
|
||||||
collect_spans_and_sources, print_sidebar, scrape_examples_help, sidebar_module_like, AllTypes,
|
collect_spans_and_sources, print_sidebar, scrape_examples_help, sidebar_module_like, AllTypes,
|
||||||
LinkFromSrc, NameDoc, StylePath, BASIC_KEYWORDS,
|
LinkFromSrc, NameDoc, StylePath,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::clean::{self, types::ExternalLocation, ExternalCrate};
|
use crate::clean::{self, types::ExternalLocation, ExternalCrate};
|
||||||
@ -195,7 +195,6 @@ fn render_item(&mut self, it: &clean::Item, is_module: bool) -> String {
|
|||||||
self.shared.layout.krate
|
self.shared.layout.krate
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
let keywords = make_item_keywords(it);
|
|
||||||
let name;
|
let name;
|
||||||
let tyname_s = if it.is_crate() {
|
let tyname_s = if it.is_crate() {
|
||||||
name = format!("{} crate", tyname);
|
name = format!("{} crate", tyname);
|
||||||
@ -212,7 +211,6 @@ fn render_item(&mut self, it: &clean::Item, is_module: bool) -> String {
|
|||||||
static_root_path: clone_shared.static_root_path.as_deref(),
|
static_root_path: clone_shared.static_root_path.as_deref(),
|
||||||
title: &title,
|
title: &title,
|
||||||
description: &desc,
|
description: &desc,
|
||||||
keywords: &keywords,
|
|
||||||
resource_suffix: &clone_shared.resource_suffix,
|
resource_suffix: &clone_shared.resource_suffix,
|
||||||
};
|
};
|
||||||
let mut page_buffer = Buffer::html();
|
let mut page_buffer = Buffer::html();
|
||||||
@ -598,7 +596,6 @@ fn after_krate(&mut self) -> Result<(), Error> {
|
|||||||
root_path: "../",
|
root_path: "../",
|
||||||
static_root_path: shared.static_root_path.as_deref(),
|
static_root_path: shared.static_root_path.as_deref(),
|
||||||
description: "List of all items in this crate",
|
description: "List of all items in this crate",
|
||||||
keywords: BASIC_KEYWORDS,
|
|
||||||
resource_suffix: &shared.resource_suffix,
|
resource_suffix: &shared.resource_suffix,
|
||||||
};
|
};
|
||||||
let all = shared.all.replace(AllTypes::new());
|
let all = shared.all.replace(AllTypes::new());
|
||||||
@ -828,7 +825,3 @@ fn cache(&self) -> &Cache {
|
|||||||
&self.shared.cache
|
&self.shared.cache
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn make_item_keywords(it: &clean::Item) -> String {
|
|
||||||
format!("{}, {}", BASIC_KEYWORDS, it.name.as_ref().unwrap())
|
|
||||||
}
|
|
||||||
|
@ -2743,8 +2743,6 @@ fn sidebar_foreign_type(cx: &Context<'_>, buf: &mut Buffer, it: &clean::Item) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) const BASIC_KEYWORDS: &str = "rust, rustlang, rust-lang";
|
|
||||||
|
|
||||||
/// Returns a list of all paths used in the type.
|
/// Returns a list of all paths used in the type.
|
||||||
/// This is used to help deduplicate imported impls
|
/// This is used to help deduplicate imported impls
|
||||||
/// for reexported types. If any of the contained
|
/// for reexported types. If any of the contained
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
use serde::ser::SerializeSeq;
|
use serde::ser::SerializeSeq;
|
||||||
use serde::{Serialize, Serializer};
|
use serde::{Serialize, Serializer};
|
||||||
|
|
||||||
use super::{collect_paths_for_type, ensure_trailing_slash, Context, BASIC_KEYWORDS};
|
use super::{collect_paths_for_type, ensure_trailing_slash, Context};
|
||||||
use crate::clean::Crate;
|
use crate::clean::Crate;
|
||||||
use crate::config::{EmitType, RenderOptions};
|
use crate::config::{EmitType, RenderOptions};
|
||||||
use crate::docfs::PathError;
|
use crate::docfs::PathError;
|
||||||
@ -340,7 +340,6 @@ fn add_path(self: &Rc<Self>, path: &Path) {
|
|||||||
root_path: "./",
|
root_path: "./",
|
||||||
static_root_path: shared.static_root_path.as_deref(),
|
static_root_path: shared.static_root_path.as_deref(),
|
||||||
description: "List of crates",
|
description: "List of crates",
|
||||||
keywords: BASIC_KEYWORDS,
|
|
||||||
resource_suffix: &shared.resource_suffix,
|
resource_suffix: &shared.resource_suffix,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
use crate::html::format::Buffer;
|
use crate::html::format::Buffer;
|
||||||
use crate::html::highlight;
|
use crate::html::highlight;
|
||||||
use crate::html::layout;
|
use crate::html::layout;
|
||||||
use crate::html::render::{Context, BASIC_KEYWORDS};
|
use crate::html::render::Context;
|
||||||
use crate::visit::DocVisitor;
|
use crate::visit::DocVisitor;
|
||||||
|
|
||||||
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
|
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
|
||||||
@ -228,7 +228,6 @@ fn emit_source(
|
|||||||
root_path: &root_path,
|
root_path: &root_path,
|
||||||
static_root_path: shared.static_root_path.as_deref(),
|
static_root_path: shared.static_root_path.as_deref(),
|
||||||
description: &desc,
|
description: &desc,
|
||||||
keywords: BASIC_KEYWORDS,
|
|
||||||
resource_suffix: &shared.resource_suffix,
|
resource_suffix: &shared.resource_suffix,
|
||||||
};
|
};
|
||||||
let v = layout::render(
|
let v = layout::render(
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> {#- -#}
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> {#- -#}
|
||||||
<meta name="generator" content="rustdoc"> {#- -#}
|
<meta name="generator" content="rustdoc"> {#- -#}
|
||||||
<meta name="description" content="{{page.description}}"> {#- -#}
|
<meta name="description" content="{{page.description}}"> {#- -#}
|
||||||
<meta name="keywords" content="{{page.keywords}}"> {#- -#}
|
|
||||||
<title>{{page.title}}</title> {#- -#}
|
<title>{{page.title}}</title> {#- -#}
|
||||||
<link rel="preload" as="font" type="font/woff2" crossorigin href="{{static_root_path|safe}}{{files.source_serif_4_regular}}"> {#- -#}
|
<link rel="preload" as="font" type="font/woff2" crossorigin href="{{static_root_path|safe}}{{files.source_serif_4_regular}}"> {#- -#}
|
||||||
<link rel="preload" as="font" type="font/woff2" crossorigin href="{{static_root_path|safe}}{{files.fira_sans_regular}}"> {#- -#}
|
<link rel="preload" as="font" type="font/woff2" crossorigin href="{{static_root_path|safe}}{{files.fira_sans_regular}}"> {#- -#}
|
||||||
|
Loading…
Reference in New Issue
Block a user