Skip to content

Commit 42bfd0b

Browse files
committed
add index-text to the main page and use that to link other blogs
1 parent 2a0de32 commit 42bfd0b

File tree

5 files changed

+18
-6
lines changed

5 files changed

+18
-6
lines changed

posts/blog.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
title: Rust Blog
22
index-title: The Rust Programming Language Blog
33
description: Empowering everyone to build reliable and efficient software.
4+
index-html: This is the <b>main Rust blog</b>. We use this blog to
5+
announce big developments in the world of Rust.
46
maintained-by: the Rust Team
57
requires-team: false
68

posts/inside-rust/blog.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
title: Inside Rust blog
22
index-title: the Inside Rust blog
33
description: Want to follow along with Rust development? Curious how you might get involved? Take a look!
4+
index-html: This is the <b>"Inside Rust"</b> blog. This blog is aimed at those who wish
5+
to follow along with Rust development. The various
6+
<a href="https://www.rust-lang.org/governance">Rust teams and working groups</a>
7+
use this blog to post status updates, calls for help, and other
8+
similar announcements.
49
maintained-by: the Rust Teams
510
requires-team: true

src/blogs.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pub(crate) struct Manifest {
1313
pub(crate) index_title: String,
1414
pub(crate) description: String,
1515
pub(crate) maintained_by: String,
16+
pub(crate) index_html: String,
1617
pub(crate) requires_team: bool,
1718
}
1819

@@ -22,6 +23,7 @@ pub(crate) struct Blog {
2223
index_title: String,
2324
description: String,
2425
maintained_by: String,
26+
index_html: String,
2527
#[serde(serialize_with = "add_postfix_slash")]
2628
prefix: PathBuf,
2729
posts: Vec<Post>,
@@ -55,6 +57,7 @@ impl Blog {
5557
index_title: manifest.index_title,
5658
description: manifest.description,
5759
maintained_by: manifest.maintained_by,
60+
index_html: manifest.index_html,
5861
prefix,
5962
posts,
6063
})

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ impl Generator {
134134
let other_blogs: Vec<_> = self.blogs.iter().filter(|b| b.index_title() != blog.index_title())
135135
.map(|other_blog| json!({
136136
"name": other_blog.index_title(),
137-
"url": other_blog.prefix().join("index.html"),
137+
"url": PathBuf::from("/").join(other_blog.prefix()).join("index.html"),
138138
}))
139139
.collect();
140140

templates/index.hbs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
{{#*inline "page"}}
2-
<header class="mt3 mt0-ns mb6-ns">
2+
<header class="mt3 mt0-ns mb4-ns">
33
<div class="container flex flex-column flex-row-l justify-between-l">
4-
<div class="mw8-l">
5-
<h1>Posts</h1>
4+
<div class="mw6-l">
5+
<p>{{{blog.index_html}}}</p>
66
</div>
7-
</div>
7+
</div>
88
<div class="container flex flex-column flex-row-l justify-between-l">
99
<div class="mw8-l">
10+
<p>
1011
<b>See also:</b>
1112
{{#each other_blogs}}
1213
<a href="{{url}}">{{name}}</a>
1314
{{/each}}
15+
</p>
1416
</div>
1517
</div>
1618
</header>
@@ -22,7 +24,7 @@
2224
{{#each blog.posts}}
2325
{{#if show_year}}<tr>
2426
<td class="bn"></td>
25-
<td class="bn"><h3 class="f0-l f1-m f2-s mt4 mb0">{{year}}</h3></td>
27+
<td class="bn"><h3 class="f0-l f1-m f2-s mt4 mb0">Posts in {{year}}</h3></td>
2628
</tr>{{/if}}
2729
<tr>
2830
<td class="tr o-60 pr4 pr5-l bn">{{month_name month}}&nbsp;{{day}}</td>

0 commit comments

Comments
 (0)