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:
parent
24e6d6b605
commit
3049d9f103
@ -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.
|
||||||
|
@ -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)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user