Actually, don't change source root

The book paths have to gracefully degrade to the default language if
they aren't available.
This commit is contained in:
Ruin0x11 2020-08-27 16:35:00 -07:00
parent 24e6d6b605
commit 3049d9f103
3 changed files with 3 additions and 6 deletions

View File

@ -352,8 +352,7 @@ impl MDBook {
/// Get the directory containing this book's source files. /// Get the directory containing this book's source files.
pub fn source_dir(&self) -> PathBuf { 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(&self.config.book.src)
self.root.join(src)
} }
/// Get the directory containing the theme resources for the book. /// Get the directory containing the theme resources for the book.

View File

@ -53,8 +53,7 @@ impl PreprocessorContext {
/// Get the directory containing this book's source files. /// Get the directory containing this book's source files.
pub fn source_dir(&self) -> PathBuf { 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(&self.config.book.src)
self.root.join(src)
} }
} }

View File

@ -94,8 +94,7 @@ impl RenderContext {
/// Get the source directory's (absolute) path on disk. /// Get the source directory's (absolute) path on disk.
pub fn source_dir(&self) -> PathBuf { 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(&self.config.book.src)
self.root.join(src)
} }
/// Load a `RenderContext` from its JSON representation. /// Load a `RenderContext` from its JSON representation.