diff --git a/content/_index.md b/content/_index.md index 3e926af75..f166b082e 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1,11 +1,11 @@ +++ title = "Rust Blog" index_title = "The Rust Programming Language Blog" -link_text = "the main Rust blog" description = "Empowering everyone to build reliable and efficient software." index_html = """ This is the main Rust blog. \ Rust teams \ use this blog to announce major developments in the world of Rust.""" maintained_by = "the Rust Teams" +see_also_html = """the "Inside Rust" blog""" +++ diff --git a/content/inside-rust/_index.md b/content/inside-rust/_index.md index 11ae3b7b0..a2c2d0579 100644 --- a/content/inside-rust/_index.md +++ b/content/inside-rust/_index.md @@ -1,7 +1,6 @@ +++ title = "Inside Rust Blog" index_title = 'The "Inside Rust" Blog' -link_text = 'the "Inside Rust" blog' description = "Want to follow along with Rust development? Curious how you might get involved? Take a look!" index_html = """ This is the "Inside Rust" blog. This blog is aimed at those who wish \ @@ -10,4 +9,5 @@ to follow along with Rust development. The various \ use this blog to post status updates, calls for help, and other \ similar announcements.""" maintained_by = "the Rust Teams" +see_also_html = """the main Rust blog""" +++ diff --git a/src/blogs.rs b/src/blogs.rs index 69990888b..afaef2eb8 100644 --- a/src/blogs.rs +++ b/src/blogs.rs @@ -23,16 +23,15 @@ pub struct Manifest { /// Raw html describing the blog to insert into the index page. pub(crate) index_html: String, - /// What text to use when linking to this blog in the "see also" - /// section from other blogs. - pub(crate) link_text: String, + /// What to show in the "see also" section of this blog. + pub(crate) see_also_html: String, } #[derive(Serialize)] pub struct Blog { title: String, index_title: String, - link_text: String, + see_also_html: String, description: String, maintained_by: String, index_html: String, @@ -93,7 +92,7 @@ impl Blog { description: manifest.description, maintained_by: manifest.maintained_by, index_html: manifest.index_html, - link_text: manifest.link_text, + see_also_html: manifest.see_also_html, path, pages: posts, }) @@ -103,10 +102,6 @@ impl Blog { &self.title } - pub(crate) fn link_text(&self) -> &str { - &self.link_text - } - pub(crate) fn index_title(&self) -> &str { &self.index_title } diff --git a/src/lib.rs b/src/lib.rs index 862165047..2db10f173 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -128,22 +128,9 @@ impl Generator { } fn render_index(&self, blog: &Blog) -> eyre::Result { - let other_blogs: Vec<_> = self - .blogs - .iter() - .filter(|b| b.index_title() != blog.index_title()) - .map(|other_blog| { - json!({ - "link_text": other_blog.link_text(), - "url": other_blog.path().join("index.html"), - }) - }) - .collect(); - let data = json!({ "title": blog.index_title(), "section": blog, - "other_blogs": other_blogs, }); let path = blog.path().join("index.html"); self.render_template(&path, "index.html", data)?; diff --git a/templates/index.html b/templates/index.html index 73d6e9266..712101609 100644 --- a/templates/index.html +++ b/templates/index.html @@ -11,9 +11,7 @@

See also: - {%- for other in other_blogs %} - {{ macros::escape_hbs(input=other.link_text) }} - {%- endfor %} + {{ section.see_also_html }}