Skip to content

Instantly share code, notes, and snippets.

@artisonian
Forked from wolfeidau/sass_converter.rb
Created March 18, 2012 23:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artisonian/2084817 to your computer and use it in GitHub Desktop.
Save artisonian/2084817 to your computer and use it in GitHub Desktop.
Sass plugin for Jekyll
module Jekyll
# Sass plugin to convert .scss to .css
#
# Note: This is configured to use the new css like syntax available in sass.
require 'sass'
require 'compass'
class SassConverter < Converter
safe true
priority :low
def matches(ext)
ext =~ /scss/i
end
def output_ext(ext)
".css"
end
def convert(content)
begin
puts "Performing Sass Conversion."
Compass.add_project_configuration
Compass.configuration.project_path ||= Dir.pwd
load_paths = [".", "./css"]
load_paths += Compass.configuration.sass_load_paths
engine = Sass::Engine.new(content, :syntax => :scss, :load_paths => load_paths, :style => :compact)
engine.render
rescue StandardError => e
puts "!!! SASS Error: " + e.message
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment