Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the nanoc SASS filter to use SCSS syntax?

Tags:

ruby

nanoc

In my nanoc site, I want to specify my styles using SCSS:

p {
  em {
    color: red;
  }
}

... not SASS:

p 
  em 
    color: red

But if I try using SCSS, I get a compile error from the SASS filter. How do I get it to use SCSS?

like image 244
Nathan Long Avatar asked Nov 15 '12 12:11

Nathan Long


1 Answers

This turned out to be quite simple:

filter :sass, syntax: :scss

Filters in nanoc seem to follow the pattern of taking any options they're given and passing them along to whatever object actually does the work. For instance, Nanoc::Filters::Sass does this in its run method:

def run(content, params={})
  options = params.dup
  # supply default options, etc...
  engine = ::Sass::Engine.new(content, options)
  # ...
  engine.render
end

Sass::Engine, in turn, has :syntax as an available option.

like image 171
Nathan Long Avatar answered Oct 01 '22 21:10

Nathan Long