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