@@ -742,8 +742,10 @@ 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 ( ) ,
748
+ description : desc. as_slice ( ) ,
747
749
ty : "source" ,
748
750
root_path : root_path. as_slice ( ) ,
749
751
} ;
@@ -1072,8 +1074,11 @@ impl Context {
1072
1074
try!( stability. encode ( & mut json:: Encoder :: new ( & mut json_out) ) ) ;
1073
1075
1074
1076
let title = stability. name . clone ( ) . append ( " - Stability dashboard" ) ;
1077
+ let desc = format ! ( "API stability overview for the Rust `{}` crate." ,
1078
+ this. layout. krate) ;
1075
1079
let page = layout:: Page {
1076
1080
ty : "mod" ,
1081
+ description : desc. as_slice ( ) ,
1077
1082
root_path : this. root_path . as_slice ( ) ,
1078
1083
title : title. as_slice ( ) ,
1079
1084
} ;
@@ -1120,8 +1125,21 @@ impl Context {
1120
1125
title. push_str ( it. name . get_ref ( ) . as_slice ( ) ) ;
1121
1126
}
1122
1127
title. push_str ( " - Rust" ) ;
1128
+ let tyname = shortty ( it) . to_static_str ( ) ;
1129
+ let is_crate = match it. inner {
1130
+ clean:: ModuleItem ( clean:: Module { items : _, is_crate : true } ) => true ,
1131
+ _ => false
1132
+ } ;
1133
+ let desc = if is_crate {
1134
+ format ! ( "API documentation for the Rust `{}` crate." ,
1135
+ cx. layout. krate)
1136
+ } else {
1137
+ format ! ( "API documentation for the Rust `{}` {} in crate `{}`." ,
1138
+ it. name. get_ref( ) , tyname, cx. layout. krate)
1139
+ } ;
1123
1140
let page = layout:: Page {
1124
- ty : shortty ( it) . to_static_str ( ) ,
1141
+ ty : tyname,
1142
+ description : desc. as_slice ( ) ,
1125
1143
root_path : cx. root_path . as_slice ( ) ,
1126
1144
title : title. as_slice ( ) ,
1127
1145
} ;
0 commit comments