@@ -182,6 +182,16 @@ impl HtmlHandlebars {
182
182
handlebars. register_helper ( "previous" , Box :: new ( helpers:: navigation:: previous) ) ;
183
183
handlebars. register_helper ( "next" , Box :: new ( helpers:: navigation:: next) ) ;
184
184
}
185
+
186
+ fn copy_additional_css ( & self , book : & MDBook ) -> Result < ( ) , Box < Error > > {
187
+ for custom_file in book. get_additional_css ( )
188
+ . iter ( )
189
+ . chain ( book. get_additional_js ( ) . iter ( ) ) {
190
+ self . write_custom_file ( custom_file, book) ?;
191
+ }
192
+
193
+ Ok ( ( ) )
194
+ }
185
195
}
186
196
187
197
@@ -198,7 +208,6 @@ impl Renderer for HtmlHandlebars {
198
208
handlebars
199
209
. register_template_string ( "index" , String :: from_utf8 ( theme. index . clone ( ) ) ?) ?;
200
210
201
- // Register helpers
202
211
debug ! ( "[*]: Register handlebars helpers" ) ;
203
212
self . register_hbs_helpers ( & mut handlebars) ;
204
213
@@ -236,12 +245,7 @@ impl Renderer for HtmlHandlebars {
236
245
// Copy static files (js, css, images, ...)
237
246
debug ! ( "[*] Copy static files" ) ;
238
247
self . copy_static_files ( book, & theme) ?;
239
-
240
- for custom_file in book. get_additional_css ( )
241
- . iter ( )
242
- . chain ( book. get_additional_js ( ) . iter ( ) ) {
243
- self . write_custom_file ( custom_file, book) ?;
244
- }
248
+ self . copy_additional_css ( book) ?;
245
249
246
250
// Copy all remaining files
247
251
utils:: fs:: copy_files_except_ext ( book. get_source ( ) , & destination, true , & [ "md" ] ) ?;
0 commit comments