Sha256: 29f5d30afdc178c92c71fb2f999fd069e6d8d982bbd776fc006030784f5fd31d

Contents?: true

Size: 555 Bytes

Versions: 2

Compression:

Stored size: 555 Bytes

Contents

# Render text via the Sass library (part of Haml)
if try_require('sass', 'haml')

  Webby::Filters.register :sass do |input, cursor|
    opts = ::Webby.site.sass_options.merge(cursor.page.sass_options || {})
    opts = opts.symbolize_keys
    opts[:style] = opts[:style].to_sym if opts.include? :style
    Sass::Engine.new(input, opts).render
  end

# Otherwise raise an error if the user tries to use sass
else
  Webby::Filters.register :sass do |input, cursor|
    raise Webby::Error, "'haml' must be installed to use the sass filter"
  end
end

# EOF

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
dysinger-webby-0.9.4 lib/webby/filters/sass.rb
mikker-webby-0.9.4 lib/webby/filters/sass.rb