aboutsummaryrefslogtreecommitdiff
path: root/.themes/classic/plugins/haml.rb
diff options
context:
space:
mode:
Diffstat (limited to '.themes/classic/plugins/haml.rb')
-rw-r--r--.themes/classic/plugins/haml.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/.themes/classic/plugins/haml.rb b/.themes/classic/plugins/haml.rb
new file mode 100644
index 00000000..7e548dec
--- /dev/null
+++ b/.themes/classic/plugins/haml.rb
@@ -0,0 +1,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