From 24d47845f4ec59c152466b32b40b40f1a469431d Mon Sep 17 00:00:00 2001 From: Anna Harren Date: Wed, 22 Jul 2020 18:46:22 +0200 Subject: [PATCH] Ignore sass directories starting with _ (#1084) Prior to this change, only sass files starting with _ were ignored by Zola's sass compiler. This made using sass frameworks incredibly inconvenient, as Zola attempted to compile every single sass file in the framework, and inevitably errored due to them not being standalone. For example, to use the Bulma framework, you had to manually add an underscore to the beginning of *every* sass file in it so Zola would stop trying to compile them as standalone css files. Now you can change the directory name to _bulma and have the same result. --- components/site/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/site/src/lib.rs b/components/site/src/lib.rs index 19e9e449..8643f3ba 100644 --- a/components/site/src/lib.rs +++ b/components/site/src/lib.rs @@ -882,7 +882,7 @@ impl Site { .expect("Invalid glob for sass") .filter_map(|e| e.ok()) .filter(|entry| { - !entry.as_path().file_name().unwrap().to_string_lossy().starts_with('_') + !entry.as_path().components().any(|c| c.as_os_str().to_string_lossy().starts_with('_')) }) .collect::>();