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.
This commit is contained in:
Anna Harren 2020-07-22 18:46:22 +02:00 committed by GitHub
parent d21ac14423
commit 24d47845f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -882,7 +882,7 @@ impl Site {
.expect("Invalid glob for sass") .expect("Invalid glob for sass")
.filter_map(|e| e.ok()) .filter_map(|e| e.ok())
.filter(|entry| { .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::<Vec<_>>(); .collect::<Vec<_>>();