@@ -106,7 +106,7 @@ impl Generator {
106106 }
107107
108108 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 ( ) ) ) ?;
110110
111111 let path = self . render_index ( blog) ?;
112112
@@ -135,24 +135,24 @@ impl Generator {
135135 . map ( |other_blog| {
136136 json ! ( {
137137 "link_text" : other_blog. link_text( ) ,
138- "url" : other_blog. prefix ( ) . join( "index.html" ) ,
138+ "url" : other_blog. path ( ) . join( "index.html" ) ,
139139 } )
140140 } )
141141 . collect ( ) ;
142142
143143 let data = json ! ( {
144144 "title" : blog. index_title( ) ,
145- "blog " : blog,
145+ "section " : blog,
146146 "other_blogs" : other_blogs,
147147 } ) ;
148- let path = blog. prefix ( ) . join ( "index.html" ) ;
148+ let path = blog. path ( ) . join ( "index.html" ) ;
149149 self . render_template ( & path, "index.html" , data) ?;
150150 Ok ( path)
151151 }
152152
153153 fn render_post ( & self , blog : & Blog , post : & Post ) -> eyre:: Result < PathBuf > {
154154 let path = blog
155- . prefix ( )
155+ . path ( )
156156 . join ( format ! ( "{:04}" , & post. year) )
157157 . join ( format ! ( "{:02}" , & post. month) )
158158 . join ( format ! ( "{:02}" , & post. day) ) ;
@@ -164,8 +164,8 @@ impl Generator {
164164
165165 let data = json ! ( {
166166 "title" : format!( "{} | {}" , post. title, blog. title( ) ) ,
167- "blog " : blog,
168- "post " : post,
167+ "section " : blog,
168+ "page " : post,
169169 } ) ;
170170
171171 let path = path. join ( filename) ;
@@ -176,12 +176,12 @@ impl Generator {
176176 fn render_feed ( & self , blog : & Blog ) -> eyre:: Result < ( ) > {
177177 let posts: Vec < _ > = blog. posts ( ) . iter ( ) . take ( 10 ) . collect ( ) ;
178178 let data = json ! ( {
179- "blog " : blog,
180- "posts " : posts,
179+ "section " : blog,
180+ "pages " : posts,
181181 "feed_updated" : chrono:: Utc :: now( ) . with_nanosecond( 0 ) . unwrap( ) . to_rfc3339( ) ,
182182 } ) ;
183183
184- self . render_template ( blog. prefix ( ) . join ( "feed.xml" ) , "feed.xml" , data) ?;
184+ self . render_template ( blog. path ( ) . join ( "feed.xml" ) , "feed.xml" , data) ?;
185185 Ok ( ( ) )
186186 }
187187
@@ -193,8 +193,8 @@ impl Generator {
193193 . map ( |post| ReleasePost {
194194 title : post. title . clone ( ) ,
195195 url : blog
196- . prefix ( )
197- . join ( post. url . clone ( ) )
196+ . path ( )
197+ . join ( post. path . clone ( ) )
198198 . to_string_lossy ( )
199199 . to_string ( ) ,
200200 } )
@@ -204,7 +204,7 @@ impl Generator {
204204 feed_updated : chrono:: Utc :: now ( ) . with_nanosecond ( 0 ) . unwrap ( ) . to_rfc3339 ( ) ,
205205 } ;
206206 fs:: write (
207- self . out_directory . join ( blog. prefix ( ) ) . join ( "releases.json" ) ,
207+ self . out_directory . join ( blog. path ( ) ) . join ( "releases.json" ) ,
208208 serde_json:: to_string ( & data) ?,
209209 ) ?;
210210 Ok ( ( ) )
0 commit comments