Skip to content

Commit e0c69a3

Browse files
committed
log error message if specified theme directory does not exist
1 parent e1c2e1a commit e0c69a3

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/config.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,13 @@ impl HtmlConfig {
580580
/// directory is not present it will append the default directory of "theme"
581581
pub fn theme_dir(&self, root: &Path) -> PathBuf {
582582
match self.theme {
583-
Some(ref d) => root.join(d),
583+
Some(ref d) => {
584+
let dir = root.join(d);
585+
if !dir.is_dir() {
586+
error!("theme dir {:?} does not exist", d);
587+
}
588+
dir
589+
}
584590
None => root.join("theme"),
585591
}
586592
}

src/renderer/html_handlebars/hbs_renderer.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -480,10 +480,7 @@ impl Renderer for HtmlHandlebars {
480480
trace!("render");
481481
let mut handlebars = Handlebars::new();
482482

483-
let theme_dir = match html_config.theme {
484-
Some(ref theme) => ctx.root.join(theme),
485-
None => ctx.root.join("theme"),
486-
};
483+
let theme_dir = html_config.theme_dir(&ctx.root);
487484

488485
if html_config.theme.is_none()
489486
&& maybe_wrong_theme_dir(&src_dir.join("theme")).unwrap_or(false)

0 commit comments

Comments
 (0)