mirror of
https://github.com/getzola/zola
synced 2024-12-13 22:02:29 +00:00
Use compile_file for sass
This commit is contained in:
parent
d78477b619
commit
7ace63a6c5
3 changed files with 8 additions and 4 deletions
|
@ -32,11 +32,11 @@ use tera::{Tera, Context};
|
|||
use walkdir::WalkDir;
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
use sass_rs::{Options, compile_string};
|
||||
use sass_rs::{Options, compile_file};
|
||||
|
||||
use errors::{Result, ResultExt};
|
||||
use config::{Config, get_config};
|
||||
use utils::fs::{create_file, read_file, create_directory, ensure_directory_exists};
|
||||
use utils::fs::{create_file, create_directory, ensure_directory_exists};
|
||||
use content::{Page, Section, populate_previous_and_next_pages, sort_pages};
|
||||
use templates::{GUTENBERG_TERA, global_fns, render_redirect_template};
|
||||
use front_matter::{SortBy, InsertAnchor};
|
||||
|
@ -462,8 +462,7 @@ impl Site {
|
|||
|
||||
for file in files {
|
||||
let name = file.as_path().file_stem().unwrap().to_string_lossy();
|
||||
let content = read_file(&file)?;
|
||||
let css = match compile_string(&content, Options::default()) {
|
||||
let css = match compile_file(file.as_path().to_str().unwrap(), Options::default()) {
|
||||
Ok(c) => c,
|
||||
Err(e) => bail!(e)
|
||||
};
|
||||
|
|
3
components/site/test_site/sass/_included.scss
Normal file
3
components/site/test_site/sass/_included.scss
Normal file
|
@ -0,0 +1,3 @@
|
|||
.container {
|
||||
font-size: 2rem;
|
||||
}
|
|
@ -5,3 +5,5 @@ body {
|
|||
background: blue;
|
||||
}
|
||||
}
|
||||
|
||||
@import "included";
|
||||
|
|
Loading…
Reference in a new issue