Module: Jekyll::Convertible
- Defined in:
- lib/jekyll/rendering.rb
Instance Method Summary collapse
- #_rendering_original_do_layout ⇒ Object
-
#do_layout(payload, layouts) ⇒ Object
Overwrites the original method to use the configured rendering engine.
-
#engine ⇒ Object
call-seq: engine => aClass.
Instance Method Details
#_rendering_original_do_layout ⇒ Object
50 |
# File 'lib/jekyll/rendering.rb', line 50 alias_method :_rendering_original_do_layout, :do_layout |
#do_layout(payload, layouts) ⇒ Object
Overwrites the original method to use the configured rendering engine.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/jekyll/rendering.rb', line 53 def do_layout(payload, layouts) info = { :filters => [Jekyll::Filters], :registers => { :site => site } } payload['pygments_prefix'] = converter.pygments_prefix payload['pygments_suffix'] = converter.pygments_suffix # render and transform content (this becomes the final content of the object) self.content = engine.render(payload, content, info, data) transform # output keeps track of what will finally be written self.output = content # recursively render layouts layout = self while layout = layouts[layout.data['layout']] payload = payload.deep_merge('content' => output, 'page' => layout.data) self.output = engine.render(payload, output, info, data, layout.content) end end |
#engine ⇒ Object
call-seq:
engine => aClass
Returns the Engine class according to the configuration setting for engine
(see subclasses of Engine::Base). Defaults to Engine::Liquid.
80 81 82 |
# File 'lib/jekyll/rendering.rb', line 80 def engine @engine ||= Engine[site.config['engine'] ||= 'liquid'] end |