@@ -748,6 +748,7 @@ impl<'a> SourceCollector<'a> {
748
748
ty : "source" ,
749
749
root_path : root_path. as_slice ( ) ,
750
750
description : desc. as_slice ( ) ,
751
+ keywords : get_basic_keywords ( ) ,
751
752
} ;
752
753
try!( layout:: render ( & mut w as & mut Writer , & self . cx . layout ,
753
754
& page, & ( "" ) , & Source ( contents) ) ) ;
@@ -1081,6 +1082,7 @@ impl Context {
1081
1082
root_path : this. root_path . as_slice ( ) ,
1082
1083
title : title. as_slice ( ) ,
1083
1084
description : desc. as_slice ( ) ,
1085
+ keywords : get_basic_keywords ( ) ,
1084
1086
} ;
1085
1087
let html_dst = & this. dst . join ( "stability.html" ) ;
1086
1088
let mut html_out = BufferedWriter :: new ( try!( File :: create ( html_dst) ) ) ;
@@ -1137,11 +1139,13 @@ impl Context {
1137
1139
format ! ( "API documentation for the Rust `{}` {} in crate `{}`." ,
1138
1140
it. name. get_ref( ) , tyname, cx. layout. krate)
1139
1141
} ;
1142
+ let keywords = make_item_keywords ( it) ;
1140
1143
let page = layout:: Page {
1141
1144
ty : tyname,
1142
1145
root_path : cx. root_path . as_slice ( ) ,
1143
1146
title : title. as_slice ( ) ,
1144
1147
description : desc. as_slice ( ) ,
1148
+ keywords : keywords. as_slice ( ) ,
1145
1149
} ;
1146
1150
1147
1151
markdown:: reset_headers ( ) ;
@@ -2170,3 +2174,11 @@ fn ignore_private_item(it: &clean::Item) -> bool {
2170
2174
_ => false ,
2171
2175
}
2172
2176
}
2177
+
2178
+ fn get_basic_keywords ( ) -> & ' static str {
2179
+ "rust, rustlang, rust-lang"
2180
+ }
2181
+
2182
+ fn make_item_keywords ( it : & clean:: Item ) -> String {
2183
+ format ! ( "{}, {}" , get_basic_keywords( ) , it. name. get_ref( ) )
2184
+ }
0 commit comments