Skip to content

Commit d07e79d

Browse files
authored
Merge pull request #1545 from rust-lang/senekor/nwlnkplvynyo
Remove custom tracking of other blogs
2 parents 117a6dd + bc02252 commit d07e79d

File tree

5 files changed

+7
-27
lines changed

5 files changed

+7
-27
lines changed

Diff for: content/_index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
+++
22
title = "Rust Blog"
33
index_title = "The Rust Programming Language Blog"
4-
link_text = "the main Rust blog"
54
description = "Empowering everyone to build reliable and efficient software."
65
index_html = """
76
This is the <b>main Rust blog</b>. \
87
<a href="https://www.rust-lang.org/governance/">Rust teams</a> \
98
use this blog to announce major developments in the world of Rust."""
109
maintained_by = "the Rust Teams"
10+
see_also_html = """<a href="/inside-rust/index.html">the &quot;Inside Rust&quot; blog</a>"""
1111
+++

Diff for: content/inside-rust/_index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
+++
22
title = "Inside Rust Blog"
33
index_title = 'The "Inside Rust" Blog'
4-
link_text = 'the "Inside Rust" blog'
54
description = "Want to follow along with Rust development? Curious how you might get involved? Take a look!"
65
index_html = """
76
This is the <b>"Inside Rust"</b> blog. This blog is aimed at those who wish \
@@ -10,4 +9,5 @@ to follow along with Rust development. The various \
109
use this blog to post status updates, calls for help, and other \
1110
similar announcements."""
1211
maintained_by = "the Rust Teams"
12+
see_also_html = """<a href="/index.html">the main Rust blog</a>"""
1313
+++

Diff for: src/blogs.rs

+4-9
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,15 @@ pub struct Manifest {
2323
/// Raw html describing the blog to insert into the index page.
2424
pub(crate) index_html: String,
2525

26-
/// What text to use when linking to this blog in the "see also"
27-
/// section from other blogs.
28-
pub(crate) link_text: String,
26+
/// What to show in the "see also" section of this blog.
27+
pub(crate) see_also_html: String,
2928
}
3029

3130
#[derive(Serialize)]
3231
pub struct Blog {
3332
title: String,
3433
index_title: String,
35-
link_text: String,
34+
see_also_html: String,
3635
description: String,
3736
maintained_by: String,
3837
index_html: String,
@@ -93,7 +92,7 @@ impl Blog {
9392
description: manifest.description,
9493
maintained_by: manifest.maintained_by,
9594
index_html: manifest.index_html,
96-
link_text: manifest.link_text,
95+
see_also_html: manifest.see_also_html,
9796
path,
9897
pages: posts,
9998
})
@@ -103,10 +102,6 @@ impl Blog {
103102
&self.title
104103
}
105104

106-
pub(crate) fn link_text(&self) -> &str {
107-
&self.link_text
108-
}
109-
110105
pub(crate) fn index_title(&self) -> &str {
111106
&self.index_title
112107
}

Diff for: src/lib.rs

-13
Original file line numberDiff line numberDiff line change
@@ -128,22 +128,9 @@ impl Generator {
128128
}
129129

130130
fn render_index(&self, blog: &Blog) -> eyre::Result<PathBuf> {
131-
let other_blogs: Vec<_> = self
132-
.blogs
133-
.iter()
134-
.filter(|b| b.index_title() != blog.index_title())
135-
.map(|other_blog| {
136-
json!({
137-
"link_text": other_blog.link_text(),
138-
"url": other_blog.path().join("index.html"),
139-
})
140-
})
141-
.collect();
142-
143131
let data = json!({
144132
"title": blog.index_title(),
145133
"section": blog,
146-
"other_blogs": other_blogs,
147134
});
148135
let path = blog.path().join("index.html");
149136
self.render_template(&path, "index.html", data)?;

Diff for: templates/index.html

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
<div class="mw8-l">
1212
<p>
1313
<b>See also:</b>
14-
{%- for other in other_blogs %}
15-
<a href="/{{other.url}}">{{ macros::escape_hbs(input=other.link_text) }}</a>
16-
{%- endfor %}
14+
{{ section.see_also_html }}
1715
</p>
1816
</div>
1917
</div>

0 commit comments

Comments
 (0)