File tree 2 files changed +8
-5
lines changed
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -580,7 +580,13 @@ impl HtmlConfig {
580
580
/// directory is not present it will append the default directory of "theme"
581
581
pub fn theme_dir ( & self , root : & Path ) -> PathBuf {
582
582
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
+ }
584
590
None => root. join ( "theme" ) ,
585
591
}
586
592
}
Original file line number Diff line number Diff line change @@ -480,10 +480,7 @@ impl Renderer for HtmlHandlebars {
480
480
trace ! ( "render" ) ;
481
481
let mut handlebars = Handlebars :: new ( ) ;
482
482
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 ) ;
487
484
488
485
if html_config. theme . is_none ( )
489
486
&& maybe_wrong_theme_dir ( & src_dir. join ( "theme" ) ) . unwrap_or ( false )
You can’t perform that action at this time.
0 commit comments