lib/linner/template.rb in linner-0.4.6 vs lib/linner/template.rb in linner-0.5.0
- old
+ new
@@ -1,8 +1,9 @@
require "tilt"
require "sass"
require "compass"
+require "handlebars.rb"
require "coffee_script"
module Tilt
class JavascriptTemplate < PlainTemplate
self.default_mime_type = 'application/javascript'
@@ -28,11 +29,22 @@
def sass_options
super.merge(:syntax => :scss)
end
end
+ class HandlebarsTemplate < Template
+ self.default_mime_type = 'text/template'
+
+ def prepare; end
+
+ def evaluate(scope, locals, &block)
+ @output ||= Handlebars.precompile(data)
+ end
+ end
+
register CSSTemplate, "css"
register JavascriptTemplate, "js"
+ register HandlebarsTemplate, "hbs", "handlebars"
register CompassSassTemplate, "sass"
prefer CompassSassTemplate
register CompassScssTemplate, "scss"