aboutsummaryrefslogtreecommitdiff
path: root/themes/classic/_plugins/haml.rb
blob: 7e548dec97365691571d3b6e3c880717129692b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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