-
-
Save jkneb/5876832 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | |
class SassConverter < Converter | |
safe true | |
priority :low | |
def matches(ext) | |
ext =~ /scss/i | |
end | |
def output_ext(ext) | |
".css" | |
end | |
def colorize(text, color) | |
"#{color}#{text}\e[0m" | |
end | |
def convert(content) | |
begin | |
puts "Performing Sass Conversion." | |
engine = Sass::Engine.new(content, :syntax => :scss, :load_paths => ["./css/"], :style => :compact) | |
engine.render | |
rescue StandardError => e | |
puts colorize("SASS Error: "+e.message, "\e[31m") | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment