Skip to content

Instantly share code, notes, and snippets.

@remino
Forked from wolfeidau/sass_converter.rb
Created April 2, 2012 03:19
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 remino/2280289 to your computer and use it in GitHub Desktop.
Save remino/2280289 to your computer and use it in GitHub Desktop.
Sass plugin for Jekyll
module Jekyll
require 'sass'
class SassConverter < Converter
safe true
priority :low
def matches(ext)
ext =~ /sass/i
end
def output_ext(ext)
".css"
end
def convert(content)
begin
puts "Performing Sass Conversion."
engine = Sass::Engine.new(content, :syntax => :sass, :load_paths => ["./css/"])
engine.render
rescue StandardError => e
puts "!!! SASS Error: " + e.message
end
end
end
end
@matthodan
Copy link

This is great for a lightweight solution, though I've been using Jekyll Asset Pipeline since it supports minification/compression too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment