Module: Awestruct::Hamlable
- Included in:
- HamlFile
- Defined in:
- lib/awestruct/hamlable.rb
Instance Method Summary collapse
Instance Method Details
#content ⇒ Object
17 18 19 20 |
# File 'lib/awestruct/hamlable.rb', line 17 def content context = site.engine.create_context( self ) render( context ) end |
#render(context) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/awestruct/hamlable.rb', line 4 def render(context) rendered = '' begin = (site.haml || {}).inject({}){|h,(k,v)| h[k.to_sym] = v.to_sym; h } haml_engine = Haml::Engine.new( raw_page_content, ) rendered = haml_engine.render( context ) rescue => e puts e puts e.backtrace end rendered end |