mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-12-25 08:58:58 -05:00
25 lines
404 B
Ruby
25 lines
404 B
Ruby
|
module Jekyll
|
||
|
require 'haml'
|
||
|
class HamlConverter < Converter
|
||
|
safe true
|
||
|
priority :low
|
||
|
|
||
|
def matches(ext)
|
||
|
ext =~ /haml/i
|
||
|
end
|
||
|
|
||
|
def output_ext(ext)
|
||
|
".html"
|
||
|
end
|
||
|
|
||
|
def convert(content)
|
||
|
begin
|
||
|
engine = Haml::Engine.new(content)
|
||
|
engine.render
|
||
|
rescue StandardError => e
|
||
|
puts "!!! HAML Error: " + e.message
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|