Skip to content

Instantly share code, notes, and snippets.

@hql287
Forked from radamant/haml_converter.rb
Created August 2, 2016 10:12
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 hql287/b63af858dc98e630bfddde903e4601e5 to your computer and use it in GitHub Desktop.
Save hql287/b63af858dc98e630bfddde903e4601e5 to your computer and use it in GitHub Desktop.
Simple haml-sass conversion for jekyll
module Jekyll
require 'haml'
class HamlConverter < Converter
safe true
priority :low
def matches(ext)
ext =~ /haml/i
end
def output_ext(ext)
".html"
end
def convert(content)
engine = Haml::Engine.new(content)
engine.render
end
end
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)
engine = Sass::Engine.new(content)
engine.render
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment