Skip to content

Commit

Permalink
Actually, don't change source root
Browse files Browse the repository at this point in the history
The book paths have to gracefully degrade to the default language if
they aren't available.
  • Loading branch information
Ruin0x11 committed Sep 15, 2021
1 parent 24e6d6b commit 3049d9f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/book/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions src/preprocess/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/renderer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 3049d9f

Please sign in to comment.