File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -131,10 +131,18 @@ impl Generator {
131
131
}
132
132
133
133
fn render_index ( & self , blog : & Blog ) -> Result < ( ) , Box < dyn Error > > {
134
+ let other_blogs: Vec < _ > = self . blogs . iter ( ) . filter ( |b| b. index_title ( ) != blog. index_title ( ) )
135
+ . map ( |other_blog| json ! ( {
136
+ "name" : other_blog. index_title( ) ,
137
+ "url" : other_blog. prefix( ) . join( "index.html" ) ,
138
+ } ) )
139
+ . collect ( ) ;
140
+
134
141
let data = json ! ( {
135
142
"title" : blog. index_title( ) ,
136
143
"parent" : "layout" ,
137
144
"blog" : blog,
145
+ "other_blogs" : other_blogs,
138
146
} ) ;
139
147
self . render_template ( blog. prefix ( ) . join ( "index.html" ) , "index" , data) ?;
140
148
Ok ( ( ) )
Original file line number Diff line number Diff line change 2
2
<header class =" mt3 mt0-ns mb6-ns" >
3
3
<div class =" container flex flex-column flex-row-l justify-between-l" >
4
4
<div class =" mw8-l" >
5
- <h1 >Blog</h1 >
5
+ <h1 >Posts</h1 >
6
+ </div >
7
+ </div >
8
+ <div class =" container flex flex-column flex-row-l justify-between-l" >
9
+ <div class =" mw8-l" >
10
+ <b >See also:</b >
11
+ {{ #each other_blogs }}
12
+ <a href =" {{ url }} " >{{ name }} </a >
13
+ {{ /each }}
6
14
</div >
7
15
</div >
8
16
</header >
You can’t perform that action at this time.
0 commit comments