Skip to content

Commit 2568986

Browse files
fixed a typo
1 parent f946ef6 commit 2568986

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/renderer/html_handlebars/hbs_renderer.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,16 @@ impl HtmlHandlebars {
182182
handlebars.register_helper("previous", Box::new(helpers::navigation::previous));
183183
handlebars.register_helper("next", Box::new(helpers::navigation::next));
184184
}
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+
}
185195
}
186196

187197

@@ -198,7 +208,6 @@ impl Renderer for HtmlHandlebars {
198208
handlebars
199209
.register_template_string("index", String::from_utf8(theme.index.clone())?)?;
200210

201-
// Register helpers
202211
debug!("[*]: Register handlebars helpers");
203212
self.register_hbs_helpers(&mut handlebars);
204213

@@ -236,12 +245,7 @@ impl Renderer for HtmlHandlebars {
236245
// Copy static files (js, css, images, ...)
237246
debug!("[*] Copy static files");
238247
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)?;
245249

246250
// Copy all remaining files
247251
utils::fs::copy_files_except_ext(book.get_source(), &destination, true, &["md"])?;

0 commit comments

Comments
 (0)