File tree Expand file tree Collapse file tree 5 files changed +7
-27
lines changed Expand file tree Collapse file tree 5 files changed +7
-27
lines changed Original file line number Diff line number Diff line change 11+++
22title = " Rust Blog"
33index_title = " The Rust Programming Language Blog"
4- link_text = " the main Rust blog"
54description = " Empowering everyone to build reliable and efficient software."
65index_html = """
76This is the <b>main Rust blog</b>. \
87<a href="https://www.rust-lang.org/governance/">Rust teams</a> \
98use this blog to announce major developments in the world of Rust."""
109maintained_by = " the Rust Teams"
10+ see_also_html = """ <a href="/inside-rust/index.html">the "Inside Rust" blog</a>"""
1111+++
Original file line number Diff line number Diff line change 11+++
22title = " Inside Rust Blog"
33index_title = ' The "Inside Rust" Blog'
4- link_text = ' the "Inside Rust" blog'
54description = " Want to follow along with Rust development? Curious how you might get involved? Take a look!"
65index_html = """
76This 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 \
109use this blog to post status updates, calls for help, and other \
1110similar announcements."""
1211maintained_by = " the Rust Teams"
12+ see_also_html = """ <a href="/index.html">the main Rust blog</a>"""
1313+++
Original file line number Diff line number Diff 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 ) ]
3231pub 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 }
Original file line number Diff line number Diff 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) ?;
Original file line number Diff line number Diff line change 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 >
You can’t perform that action at this time.
0 commit comments