Skip to content

Instantly share code, notes, and snippets.

@bluestrike2
Created April 1, 2012 04: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 bluestrike2/2271209 to your computer and use it in GitHub Desktop.
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.
## 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