diff --git a/src/book/mod.rs b/src/book/mod.rs index 63629052..e1750e14 100644 --- a/src/book/mod.rs +++ b/src/book/mod.rs @@ -352,8 +352,7 @@ impl MDBook { /// Get the directory containing this book's source files. pub fn source_dir(&self) -> PathBuf { - let src = self.config.get_localized_src_path(self.build_opts.language_ident.as_ref()).unwrap(); - self.root.join(src) + self.root.join(&self.config.book.src) } /// Get the directory containing the theme resources for the book. diff --git a/src/preprocess/mod.rs b/src/preprocess/mod.rs index e78397b0..7da381de 100644 --- a/src/preprocess/mod.rs +++ b/src/preprocess/mod.rs @@ -53,8 +53,7 @@ impl PreprocessorContext { /// Get the directory containing this book's source files. pub fn source_dir(&self) -> PathBuf { - let src = self.config.get_localized_src_path(self.build_opts.language_ident.as_ref()).unwrap(); - self.root.join(src) + self.root.join(&self.config.book.src) } } diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs index 78ef5faa..5f41dbae 100644 --- a/src/renderer/mod.rs +++ b/src/renderer/mod.rs @@ -94,8 +94,7 @@ impl RenderContext { /// Get the source directory's (absolute) path on disk. pub fn source_dir(&self) -> PathBuf { - let src = self.config.get_localized_src_path(self.build_opts.language_ident.as_ref()).unwrap(); - self.root.join(src) + self.root.join(&self.config.book.src) } /// Load a `RenderContext` from its JSON representation.