Created
April 1, 2012 04:19
-
-
Save bluestrike2/2271209 to your computer and use it in GitHub Desktop.
Maybe Dr. Jekyll wouldn't have turned into Mr. Hyde if he was a touch slimmer. Bringing Slim to 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
## jekyll plugin: slim converter | |
## _plugins/slim-convert.rb | |
module Jekyll | |
require 'slim' | |
class SlimConverter < Converter | |
safe true | |
priority :low | |
def matches(ext) | |
ext =~ /slim/i | |
end | |
def output_ext(ext) | |
".html" | |
end | |
def convert(content) | |
Slim::Template.new({}) {content}.render() | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment