Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate with sass #12

Merged
merged 13 commits into from
May 7, 2017
Merged

Integrate with sass #12

merged 13 commits into from
May 7, 2017

Conversation

kaj
Copy link
Owner

@kaj kaj commented Mar 26, 2017

Make it possible to add the css generated from a sass file directly as a static file, and to referense other static files from that sass file (and get the correct hashed named in the generated css).

The aim of this PR is to have something like statics.add_sass_file("foo.sass") that automatically sassifies files and properly adds them.

let mut statics = StaticFiles::new(&out_dir).unwrap();
statics.add_files(&base_dir.join("static")).unwrap();
statics.add_sass_file("style.scss".as_ref()).unwrap();

The feature defines a sass function static-name that can be called with a source name of a static file to get the name including hash:

body {
    background: static_name(some.jpg);
}

@kaj kaj merged commit 26c4618 into master May 7, 2017
@kaj kaj deleted the feature/sass_feature branch May 7, 2017 15:51
kaj added a commit that referenced this pull request May 7, 2017
- Issue #10: Watch template directories for changes, to build new
  templates when they are created.
- PR #12: Integrate sass, including a function to reference static
  files from a scss document.
- Some documentation improvements and internal code cleanup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant