@@ -106,7 +106,7 @@ impl Generator {
106
106
}
107
107
108
108
fn render_blog ( & self , blog : & Blog ) -> eyre:: Result < ( ) > {
109
- std:: fs:: create_dir_all ( self . out_directory . join ( blog. prefix ( ) ) ) ?;
109
+ std:: fs:: create_dir_all ( self . out_directory . join ( blog. path ( ) ) ) ?;
110
110
111
111
let path = self . render_index ( blog) ?;
112
112
@@ -135,24 +135,24 @@ impl Generator {
135
135
. map ( |other_blog| {
136
136
json ! ( {
137
137
"link_text" : other_blog. link_text( ) ,
138
- "url" : other_blog. prefix ( ) . join( "index.html" ) ,
138
+ "url" : other_blog. path ( ) . join( "index.html" ) ,
139
139
} )
140
140
} )
141
141
. collect ( ) ;
142
142
143
143
let data = json ! ( {
144
144
"title" : blog. index_title( ) ,
145
- "blog " : blog,
145
+ "section " : blog,
146
146
"other_blogs" : other_blogs,
147
147
} ) ;
148
- let path = blog. prefix ( ) . join ( "index.html" ) ;
148
+ let path = blog. path ( ) . join ( "index.html" ) ;
149
149
self . render_template ( & path, "index.html" , data) ?;
150
150
Ok ( path)
151
151
}
152
152
153
153
fn render_post ( & self , blog : & Blog , post : & Post ) -> eyre:: Result < PathBuf > {
154
154
let path = blog
155
- . prefix ( )
155
+ . path ( )
156
156
. join ( format ! ( "{:04}" , & post. year) )
157
157
. join ( format ! ( "{:02}" , & post. month) )
158
158
. join ( format ! ( "{:02}" , & post. day) ) ;
@@ -164,8 +164,8 @@ impl Generator {
164
164
165
165
let data = json ! ( {
166
166
"title" : format!( "{} | {}" , post. title, blog. title( ) ) ,
167
- "blog " : blog,
168
- "post " : post,
167
+ "section " : blog,
168
+ "page " : post,
169
169
} ) ;
170
170
171
171
let path = path. join ( filename) ;
@@ -176,12 +176,12 @@ impl Generator {
176
176
fn render_feed ( & self , blog : & Blog ) -> eyre:: Result < ( ) > {
177
177
let posts: Vec < _ > = blog. posts ( ) . iter ( ) . take ( 10 ) . collect ( ) ;
178
178
let data = json ! ( {
179
- "blog " : blog,
180
- "posts " : posts,
179
+ "section " : blog,
180
+ "pages " : posts,
181
181
"feed_updated" : chrono:: Utc :: now( ) . with_nanosecond( 0 ) . unwrap( ) . to_rfc3339( ) ,
182
182
} ) ;
183
183
184
- self . render_template ( blog. prefix ( ) . join ( "feed.xml" ) , "feed.xml" , data) ?;
184
+ self . render_template ( blog. path ( ) . join ( "feed.xml" ) , "feed.xml" , data) ?;
185
185
Ok ( ( ) )
186
186
}
187
187
@@ -193,7 +193,7 @@ impl Generator {
193
193
. map ( |post| ReleasePost {
194
194
title : post. title . clone ( ) ,
195
195
url : blog
196
- . prefix ( )
196
+ . path ( )
197
197
. join ( post. url . clone ( ) )
198
198
. to_string_lossy ( )
199
199
. to_string ( ) ,
@@ -204,7 +204,7 @@ impl Generator {
204
204
feed_updated : chrono:: Utc :: now ( ) . with_nanosecond ( 0 ) . unwrap ( ) . to_rfc3339 ( ) ,
205
205
} ;
206
206
fs:: write (
207
- self . out_directory . join ( blog. prefix ( ) ) . join ( "releases.json" ) ,
207
+ self . out_directory . join ( blog. path ( ) ) . join ( "releases.json" ) ,
208
208
serde_json:: to_string ( & data) ?,
209
209
) ?;
210
210
Ok ( ( ) )
0 commit comments