Skip to content

Commit

Permalink
remove string manipulation of paths (#1941)
Browse files Browse the repository at this point in the history
* remove string manipulation of paths
  • Loading branch information
swiftcoder authored and Keats committed Aug 14, 2022
1 parent d8d9604 commit 93d61cd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions components/site/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,14 @@ impl Site {
/// Reads all .md files in the `content` directory and create pages/sections
/// out of them
pub fn load(&mut self) -> Result<()> {
let base_path = self.base_path.to_string_lossy().replace('\\', "/");

self.library = Arc::new(RwLock::new(Library::new(&self.config)));
let mut pages_insert_anchors = HashMap::new();

// not the most elegant loop, but this is necessary to use skip_current_dir
// which we can only decide to use after we've deserialised the section
// so it's kinda necessecary
let mut dir_walker =
WalkDir::new(format!("{}/{}", base_path, "content/")).follow_links(true).into_iter();
WalkDir::new(self.base_path.join("content")).follow_links(true).into_iter();
let mut allowed_index_filenames: Vec<_> = self
.config
.other_languages()
Expand Down

0 comments on commit 93d61cd

Please sign in to comment.