@@ -742,10 +742,13 @@ impl<'a> SourceCollector<'a> {
742
742
let mut w = BufferedWriter :: new ( try!( File :: create ( & cur) ) ) ;
743
743
744
744
let title = format ! ( "{} -- source" , cur. filename_display( ) ) ;
745
+ let desc = format ! ( "Source to the Rust file `{}`." , filename) ;
745
746
let page = layout:: Page {
746
747
title : title. as_slice ( ) ,
747
748
ty : "source" ,
748
749
root_path : root_path. as_slice ( ) ,
750
+ description : desc. as_slice ( ) ,
751
+ keywords : get_basic_keywords ( ) ,
749
752
} ;
750
753
try!( layout:: render ( & mut w as & mut Writer , & self . cx . layout ,
751
754
& page, & ( "" ) , & Source ( contents) ) ) ;
@@ -1072,10 +1075,14 @@ impl Context {
1072
1075
try!( stability. encode ( & mut json:: Encoder :: new ( & mut json_out) ) ) ;
1073
1076
1074
1077
let title = stability. name . clone ( ) . append ( " - Stability dashboard" ) ;
1078
+ let desc = format ! ( "API stability overview for the Rust `{}` crate." ,
1079
+ this. layout. krate) ;
1075
1080
let page = layout:: Page {
1076
1081
ty : "mod" ,
1077
1082
root_path : this. root_path . as_slice ( ) ,
1078
1083
title : title. as_slice ( ) ,
1084
+ description : desc. as_slice ( ) ,
1085
+ keywords : get_basic_keywords ( ) ,
1079
1086
} ;
1080
1087
let html_dst = & this. dst . join ( "stability.html" ) ;
1081
1088
let mut html_out = BufferedWriter :: new ( try!( File :: create ( html_dst) ) ) ;
@@ -1120,10 +1127,25 @@ impl Context {
1120
1127
title. push_str ( it. name . get_ref ( ) . as_slice ( ) ) ;
1121
1128
}
1122
1129
title. push_str ( " - Rust" ) ;
1130
+ let tyname = shortty ( it) . to_static_str ( ) ;
1131
+ let is_crate = match it. inner {
1132
+ clean:: ModuleItem ( clean:: Module { items : _, is_crate : true } ) => true ,
1133
+ _ => false
1134
+ } ;
1135
+ let desc = if is_crate {
1136
+ format ! ( "API documentation for the Rust `{}` crate." ,
1137
+ cx. layout. krate)
1138
+ } else {
1139
+ format ! ( "API documentation for the Rust `{}` {} in crate `{}`." ,
1140
+ it. name. get_ref( ) , tyname, cx. layout. krate)
1141
+ } ;
1142
+ let keywords = make_item_keywords ( it) ;
1123
1143
let page = layout:: Page {
1124
- ty : shortty ( it ) . to_static_str ( ) ,
1144
+ ty : tyname ,
1125
1145
root_path : cx. root_path . as_slice ( ) ,
1126
1146
title : title. as_slice ( ) ,
1147
+ description : desc. as_slice ( ) ,
1148
+ keywords : keywords. as_slice ( ) ,
1127
1149
} ;
1128
1150
1129
1151
markdown:: reset_headers ( ) ;
@@ -1311,7 +1333,7 @@ impl<'a> fmt::Show for Item<'a> {
1311
1333
// Write stability dashboard link
1312
1334
match self . item . inner {
1313
1335
clean:: ModuleItem ( ref m) if m. is_crate => {
1314
- try!( write ! ( fmt, "<a href='stability.html'>[stability dashboard ]</a> " ) ) ;
1336
+ try!( write ! ( fmt, "<a href='stability.html'>[stability]</a> " ) ) ;
1315
1337
}
1316
1338
_ => { }
1317
1339
} ;
@@ -2152,3 +2174,11 @@ fn ignore_private_item(it: &clean::Item) -> bool {
2152
2174
_ => false ,
2153
2175
}
2154
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