Skip to content

Instantly share code, notes, and snippets.

@jamesaoverton
Created October 25, 2011 19:45
Show Gist options
  • Save jamesaoverton/1314003 to your computer and use it in GitHub Desktop.
Save jamesaoverton/1314003 to your computer and use it in GitHub Desktop.
Slim converter for Jekyll.
module Jekyll
require 'slim'
Slim::Engine.set_default_options :pretty => true
class SlimConverter < Converter
safe true
priority :low
def matches(ext)
ext =~ /slim/i
end
def output_ext(ext)
".html"
end
def convert(content)
begin
engine = Tilt['slim'].new{content}
engine.render
rescue StandardError => e
puts "!!! Slim 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