Skip to content

Instantly share code, notes, and snippets.

@pattex
Created April 16, 2012 13:04
Show Gist options
  • Save pattex/2398659 to your computer and use it in GitHub Desktop.
Save pattex/2398659 to your computer and use it in GitHub Desktop.
Use Jekyll with haml
!!! 5
%html
%head
%title
= site.title
%body
= content
module Jekyll
require 'haml'
class Layout
alias_method :_original_initialize, :initialize
def initialize(*args)
_original_initialize(*args)
self.transform
end
end
class HamlConverter < Converter
safe true
priority :low
def matches(ext)
ext =~ /haml/i
end
def output_ext(ext)
'.html'
end
def convert(content)
Haml::Engine.new(content).render
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment