diff --git a/components/content/src/utils.rs b/components/content/src/utils.rs index 3153571d0..106b00fc1 100644 --- a/components/content/src/utils.rs +++ b/components/content/src/utils.rs @@ -27,7 +27,7 @@ pub fn has_anchor(headings: &[Heading], anchor: &str) -> bool { pub fn find_related_assets(path: &Path, config: &Config, recursive: bool) -> Vec { let mut assets = vec![]; - let mut builder = WalkDir::new(path); + let mut builder = WalkDir::new(path).follow_links(true); if !recursive { builder = builder.max_depth(1); } diff --git a/components/site/src/lib.rs b/components/site/src/lib.rs index c8f346ab9..6aa74cfb8 100644 --- a/components/site/src/lib.rs +++ b/components/site/src/lib.rs @@ -170,7 +170,8 @@ impl Site { // 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/")).into_iter(); + let mut dir_walker = + WalkDir::new(format!("{}/{}", base_path, "content/")).follow_links(true).into_iter(); let mut allowed_index_filenames: Vec<_> = self .config .other_languages() @@ -220,6 +221,7 @@ impl Site { // index files for all languages and process them simultaniously // before any of the pages let index_files = WalkDir::new(&path) + .follow_links(true) .max_depth(1) .into_iter() .filter_map(|e| match e { diff --git a/components/utils/src/fs.rs b/components/utils/src/fs.rs index afd6e44ac..eb5814888 100644 --- a/components/utils/src/fs.rs +++ b/components/utils/src/fs.rs @@ -111,7 +111,9 @@ pub fn copy_file_if_needed(src: &Path, dest: &Path, hard_link: bool) -> Result<( } pub fn copy_directory(src: &Path, dest: &Path, hard_link: bool) -> Result<()> { - for entry in WalkDir::new(src).into_iter().filter_map(std::result::Result::ok) { + for entry in + WalkDir::new(src).follow_links(true).into_iter().filter_map(std::result::Result::ok) + { let relative_path = entry.path().strip_prefix(src).unwrap(); let target_path = dest.join(relative_path);