aboutsummaryrefslogtreecommitdiff
path: root/_plugins/haml.rb
diff options
context:
space:
mode:
authorBrandon Mathis <brandon@imathis.com>2011-04-17 22:49:30 -0500
committerBrandon Mathis <brandon@imathis.com>2011-04-17 22:49:30 -0500
commite4c2d5790bac6a74037638fde049c374fc44cc7b (patch)
tree83f5e5b7324fcb5951d755442e2e601a3eaed35a /_plugins/haml.rb
parent4db81a9e51e452495a06ad8c57ac4ac689a9ff34 (diff)
downloadmy_new_personal_website-e4c2d5790bac6a74037638fde049c374fc44cc7b.tar.xz
my_new_personal_website-e4c2d5790bac6a74037638fde049c374fc44cc7b.zip
irrisponsibly massive commit
Diffstat (limited to '_plugins/haml.rb')
-rw-r--r--_plugins/haml.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/_plugins/haml.rb b/_plugins/haml.rb
new file mode 100644
index 00000000..7e548dec
--- /dev/null
+++ b/_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