Created
October 25, 2011 19:45
-
-
Save jamesaoverton/1314003 to your computer and use it in GitHub Desktop.
Slim converter for Jekyll.
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 | |
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