Default to compressed sass output
This commit is contained in:
parent
2db7ec4843
commit
5aed3a4a1d
|
@ -28,7 +28,7 @@ use std::path::{Path, PathBuf};
|
||||||
use glob::glob;
|
use glob::glob;
|
||||||
use tera::{Tera, Context};
|
use tera::{Tera, Context};
|
||||||
use walkdir::WalkDir;
|
use walkdir::WalkDir;
|
||||||
use sass_rs::{Options, compile_file};
|
use sass_rs::{Options, OutputStyle, compile_file};
|
||||||
|
|
||||||
use errors::{Result, ResultExt};
|
use errors::{Result, ResultExt};
|
||||||
use config::{Config, get_config};
|
use config::{Config, get_config};
|
||||||
|
@ -518,9 +518,11 @@ impl Site {
|
||||||
.filter(|entry| !entry.as_path().file_name().unwrap().to_string_lossy().starts_with('_'))
|
.filter(|entry| !entry.as_path().file_name().unwrap().to_string_lossy().starts_with('_'))
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
|
let mut sass_options = Options::default();
|
||||||
|
sass_options.output_style = OutputStyle::Compressed;
|
||||||
for file in files {
|
for file in files {
|
||||||
let name = file.as_path().file_stem().unwrap().to_string_lossy();
|
let name = file.as_path().file_stem().unwrap().to_string_lossy();
|
||||||
let css = match compile_file(file.as_path(), Options::default()) {
|
let css = match compile_file(file.as_path(), sass_options.clone()) {
|
||||||
Ok(c) => c,
|
Ok(c) => c,
|
||||||
Err(e) => bail!(e)
|
Err(e) => bail!(e)
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue