File tree 5 files changed +7
-27
lines changed
5 files changed +7
-27
lines changed Original file line number Diff line number Diff line change 1
1
+++
2
2
title = " Rust Blog"
3
3
index_title = " The Rust Programming Language Blog"
4
- link_text = " the main Rust blog"
5
4
description = " Empowering everyone to build reliable and efficient software."
6
5
index_html = """
7
6
This is the <b>main Rust blog</b>. \
8
7
<a href="https://www.rust-lang.org/governance/">Rust teams</a> \
9
8
use this blog to announce major developments in the world of Rust."""
10
9
maintained_by = " the Rust Teams"
10
+ see_also_html = """ <a href="/inside-rust/index.html">the "Inside Rust" blog</a>"""
11
11
+++
Original file line number Diff line number Diff line change 1
1
+++
2
2
title = " Inside Rust Blog"
3
3
index_title = ' The "Inside Rust" Blog'
4
- link_text = ' the "Inside Rust" blog'
5
4
description = " Want to follow along with Rust development? Curious how you might get involved? Take a look!"
6
5
index_html = """
7
6
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 \
10
9
use this blog to post status updates, calls for help, and other \
11
10
similar announcements."""
12
11
maintained_by = " the Rust Teams"
12
+ see_also_html = """ <a href="/index.html">the main Rust blog</a>"""
13
13
+++
Original file line number Diff line number Diff line change @@ -23,16 +23,15 @@ pub struct Manifest {
23
23
/// Raw html describing the blog to insert into the index page.
24
24
pub ( crate ) index_html : String ,
25
25
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 ,
29
28
}
30
29
31
30
#[ derive( Serialize ) ]
32
31
pub struct Blog {
33
32
title : String ,
34
33
index_title : String ,
35
- link_text : String ,
34
+ see_also_html : String ,
36
35
description : String ,
37
36
maintained_by : String ,
38
37
index_html : String ,
@@ -93,7 +92,7 @@ impl Blog {
93
92
description : manifest. description ,
94
93
maintained_by : manifest. maintained_by ,
95
94
index_html : manifest. index_html ,
96
- link_text : manifest. link_text ,
95
+ see_also_html : manifest. see_also_html ,
97
96
path,
98
97
pages : posts,
99
98
} )
@@ -103,10 +102,6 @@ impl Blog {
103
102
& self . title
104
103
}
105
104
106
- pub ( crate ) fn link_text ( & self ) -> & str {
107
- & self . link_text
108
- }
109
-
110
105
pub ( crate ) fn index_title ( & self ) -> & str {
111
106
& self . index_title
112
107
}
Original file line number Diff line number Diff line change @@ -128,22 +128,9 @@ impl Generator {
128
128
}
129
129
130
130
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
-
143
131
let data = json ! ( {
144
132
"title" : blog. index_title( ) ,
145
133
"section" : blog,
146
- "other_blogs" : other_blogs,
147
134
} ) ;
148
135
let path = blog. path ( ) . join ( "index.html" ) ;
149
136
self . render_template ( & path, "index.html" , data) ?;
Original file line number Diff line number Diff line change 11
11
< div class ="mw8-l ">
12
12
< p >
13
13
< 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 }}
17
15
</ p >
18
16
</ div >
19
17
</ div >
You can’t perform that action at this time.
0 commit comments