Skip to content

Commit a5a904c

Browse files
committed
document manifest fields
1 parent 84c961a commit a5a904c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/blogs.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,34 @@ static POSTS_EXT: &str = "md";
99
#[derive(Deserialize)]
1010
#[serde(rename_all = "kebab-case", deny_unknown_fields)]
1111
pub(crate) struct Manifest {
12+
/// Title to display in the "top row".
1213
pub(crate) title: String,
14+
15+
/// Title to use in the html header.
1316
pub(crate) index_title: String,
17+
18+
/// Description for metadata
1419
pub(crate) description: String,
20+
21+
/// Who maintains this blog? Appears in the rss feed.
1522
pub(crate) maintained_by: String,
23+
24+
/// Raw html describing the blog to insert into the index page.
1625
pub(crate) index_html: String,
26+
27+
/// If true, posts require a `team` in their metadata.
1728
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.
1832
pub(crate) link_text: String,
1933
}
2034

2135
#[derive(Serialize)]
2236
pub(crate) struct Blog {
2337
title: String,
2438
index_title: String,
39+
link_text: String,
2540
description: String,
2641
maintained_by: String,
2742
index_html: String,
@@ -59,6 +74,7 @@ impl Blog {
5974
description: manifest.description,
6075
maintained_by: manifest.maintained_by,
6176
index_html: manifest.index_html,
77+
link_text: manifest.link_text,
6278
prefix,
6379
posts,
6480
})
@@ -68,6 +84,10 @@ impl Blog {
6884
&self.title
6985
}
7086

87+
pub(crate) fn link_text(&self) -> &str {
88+
&self.link_text
89+
}
90+
7191
pub(crate) fn index_title(&self) -> &str {
7292
&self.index_title
7393
}

0 commit comments

Comments
 (0)