@@ -8,19 +8,38 @@ static POSTS_EXT: &str = "md";
88
99#[ derive( Deserialize ) ]
1010#[ serde( rename_all = "kebab-case" , deny_unknown_fields) ]
11- struct Manifest {
12- title : String ,
13- index_title : String ,
14- description : String ,
15- maintained_by : String ,
11+ pub ( crate ) struct Manifest {
12+ /// Title to display in the "top row".
13+ pub ( crate ) title : String ,
14+
15+ /// Title to use in the html header.
16+ pub ( crate ) index_title : String ,
17+
18+ /// Description for metadata
19+ pub ( crate ) description : String ,
20+
21+ /// Who maintains this blog? Appears in the rss feed.
22+ pub ( crate ) maintained_by : String ,
23+
24+ /// Raw html describing the blog to insert into the index page.
25+ pub ( crate ) index_html : String ,
26+
27+ /// If true, posts require a `team` in their metadata.
28+ pub ( crate ) requires_team : bool ,
29+
30+ /// What text to use when linking to this blog in the "see also"
31+ /// section from other blogs.
32+ pub ( crate ) link_text : String ,
1633}
1734
1835#[ derive( Serialize ) ]
1936pub ( crate ) struct Blog {
2037 title : String ,
2138 index_title : String ,
39+ link_text : String ,
2240 description : String ,
2341 maintained_by : String ,
42+ index_html : String ,
2443 #[ serde( serialize_with = "add_postfix_slash" ) ]
2544 prefix : PathBuf ,
2645 posts : Vec < Post > ,
@@ -36,7 +55,7 @@ impl Blog {
3655 let path = entry?. path ( ) ;
3756 let ext = path. extension ( ) . and_then ( |e| e. to_str ( ) ) ;
3857 if path. metadata ( ) ?. file_type ( ) . is_file ( ) && ext == Some ( POSTS_EXT ) {
39- posts. push ( Post :: open ( & path) ?) ;
58+ posts. push ( Post :: open ( & path, & manifest ) ?) ;
4059 }
4160 }
4261
@@ -54,6 +73,8 @@ impl Blog {
5473 index_title : manifest. index_title ,
5574 description : manifest. description ,
5675 maintained_by : manifest. maintained_by ,
76+ index_html : manifest. index_html ,
77+ link_text : manifest. link_text ,
5778 prefix,
5879 posts,
5980 } )
@@ -63,6 +84,10 @@ impl Blog {
6384 & self . title
6485 }
6586
87+ pub ( crate ) fn link_text ( & self ) -> & str {
88+ & self . link_text
89+ }
90+
6691 pub ( crate ) fn index_title ( & self ) -> & str {
6792 & self . index_title
6893 }
0 commit comments