From 3049d9f10327d33bb3ff1cb5a4d6ad7fddd5bb20 Mon Sep 17 00:00:00 2001 From: Ruin0x11 Date: Thu, 27 Aug 2020 16:35:00 -0700 Subject: [PATCH] Actually, don't change source root The book paths have to gracefully degrade to the default language if they aren't available. --- src/book/mod.rs | 3 +-- src/preprocess/mod.rs | 3 +-- src/renderer/mod.rs | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) 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.