Skip to content

Commit e776a63

Browse files
authored
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>
2 parents f95f835 + f5bac0c commit e776a63

File tree

6 files changed

+3
-16
lines changed

6 files changed

+3
-16
lines changed

src/librustdoc/html/layout.rs

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ pub(crate) struct Page<'a> {
3030
pub(crate) root_path: &'a str,
3131
pub(crate) static_root_path: Option<&'a str>,
3232
pub(crate) description: &'a str,
33-
pub(crate) keywords: &'a str,
3433
pub(crate) resource_suffix: &'a str,
3534
}
3635

src/librustdoc/html/render/context.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use super::search_index::build_index;
1818
use super::write_shared::write_shared;
1919
use super::{
2020
collect_spans_and_sources, print_sidebar, scrape_examples_help, sidebar_module_like, AllTypes,
21-
LinkFromSrc, NameDoc, StylePath, BASIC_KEYWORDS,
21+
LinkFromSrc, NameDoc, StylePath,
2222
};
2323

2424
use crate::clean::{self, types::ExternalLocation, ExternalCrate};
@@ -195,7 +195,6 @@ impl<'tcx> Context<'tcx> {
195195
self.shared.layout.krate
196196
)
197197
};
198-
let keywords = make_item_keywords(it);
199198
let name;
200199
let tyname_s = if it.is_crate() {
201200
name = format!("{} crate", tyname);
@@ -212,7 +211,6 @@ impl<'tcx> Context<'tcx> {
212211
static_root_path: clone_shared.static_root_path.as_deref(),
213212
title: &title,
214213
description: &desc,
215-
keywords: &keywords,
216214
resource_suffix: &clone_shared.resource_suffix,
217215
};
218216
let mut page_buffer = Buffer::html();
@@ -598,7 +596,6 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
598596
root_path: "../",
599597
static_root_path: shared.static_root_path.as_deref(),
600598
description: "List of all items in this crate",
601-
keywords: BASIC_KEYWORDS,
602599
resource_suffix: &shared.resource_suffix,
603600
};
604601
let all = shared.all.replace(AllTypes::new());
@@ -828,7 +825,3 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
828825
&self.shared.cache
829826
}
830827
}
831-
832-
fn make_item_keywords(it: &clean::Item) -> String {
833-
format!("{}, {}", BASIC_KEYWORDS, it.name.as_ref().unwrap())
834-
}

src/librustdoc/html/render/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -2743,8 +2743,6 @@ fn sidebar_foreign_type(cx: &Context<'_>, buf: &mut Buffer, it: &clean::Item) {
27432743
}
27442744
}
27452745

2746-
pub(crate) const BASIC_KEYWORDS: &str = "rust, rustlang, rust-lang";
2747-
27482746
/// Returns a list of all paths used in the type.
27492747
/// This is used to help deduplicate imported impls
27502748
/// for reexported types. If any of the contained

src/librustdoc/html/render/write_shared.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet};
1111
use serde::ser::SerializeSeq;
1212
use serde::{Serialize, Serializer};
1313

14-
use super::{collect_paths_for_type, ensure_trailing_slash, Context, BASIC_KEYWORDS};
14+
use super::{collect_paths_for_type, ensure_trailing_slash, Context};
1515
use crate::clean::Crate;
1616
use crate::config::{EmitType, RenderOptions};
1717
use crate::docfs::PathError;
@@ -340,7 +340,6 @@ if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex};
340340
root_path: "./",
341341
static_root_path: shared.static_root_path.as_deref(),
342342
description: "List of crates",
343-
keywords: BASIC_KEYWORDS,
344343
resource_suffix: &shared.resource_suffix,
345344
};
346345

src/librustdoc/html/sources.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::error::Error;
44
use crate::html::format::Buffer;
55
use crate::html::highlight;
66
use crate::html::layout;
7-
use crate::html::render::{Context, BASIC_KEYWORDS};
7+
use crate::html::render::Context;
88
use crate::visit::DocVisitor;
99

1010
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
@@ -228,7 +228,6 @@ impl SourceCollector<'_, '_> {
228228
root_path: &root_path,
229229
static_root_path: shared.static_root_path.as_deref(),
230230
description: &desc,
231-
keywords: BASIC_KEYWORDS,
232231
resource_suffix: &shared.resource_suffix,
233232
};
234233
let v = layout::render(

src/librustdoc/html/templates/page.html

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0"> {#- -#}
66
<meta name="generator" content="rustdoc"> {#- -#}
77
<meta name="description" content="{{page.description}}"> {#- -#}
8-
<meta name="keywords" content="{{page.keywords}}"> {#- -#}
98
<title>{{page.title}}</title> {#- -#}
109
<link rel="preload" as="font" type="font/woff2" crossorigin href="{{static_root_path|safe}}{{files.source_serif_4_regular}}"> {#- -#}
1110
<link rel="preload" as="font" type="font/woff2" crossorigin href="{{static_root_path|safe}}{{files.fira_sans_regular}}"> {#- -#}

0 commit comments

Comments
 (0)