diff --git a/src/config.rs b/src/config.rs index 951957bd42..fb8f0b6327 100644 --- a/src/config.rs +++ b/src/config.rs @@ -580,7 +580,13 @@ impl HtmlConfig { /// directory is not present it will append the default directory of "theme" pub fn theme_dir(&self, root: &Path) -> PathBuf { match self.theme { - Some(ref d) => root.join(d), + Some(ref d) => { + let dir = root.join(d); + if !dir.is_dir() { + error!("theme dir {:?} does not exist", d); + } + dir + } None => root.join("theme"), } } diff --git a/src/renderer/html_handlebars/hbs_renderer.rs b/src/renderer/html_handlebars/hbs_renderer.rs index 3d2d1afe94..1758815b4a 100644 --- a/src/renderer/html_handlebars/hbs_renderer.rs +++ b/src/renderer/html_handlebars/hbs_renderer.rs @@ -480,10 +480,7 @@ impl Renderer for HtmlHandlebars { trace!("render"); let mut handlebars = Handlebars::new(); - let theme_dir = match html_config.theme { - Some(ref theme) => ctx.root.join(theme), - None => ctx.root.join("theme"), - }; + let theme_dir = html_config.theme_dir(&ctx.root); if html_config.theme.is_none() && maybe_wrong_theme_dir(&src_dir.join("theme")).unwrap_or(false)