Class: Laze::Renderers::PageRenderer
- Inherits:
-
Renderer
- Object
- Renderer
- Laze::Renderers::PageRenderer
- Defined in:
- lib/laze/renderers/page_renderer.rb
Overview
Renders Page objects to an HTML page. This means applying text filters, layouts and the Liquid templating engine to a source file and returning the full HTML result file.
Instance Method Summary collapse
-
#initialize(page) ⇒ PageRenderer
constructor
:nodoc:.
-
#render(locals = {}) ⇒ Object
Apply layouts and the liquid templating language.
Constructor Details
#initialize(page) ⇒ PageRenderer
:nodoc:
7 8 9 10 |
# File 'lib/laze/renderers/page_renderer.rb', line 7 def initialize(page) #:nodoc: raise ArgumentError unless page.is_a?(Page) super(page.filtered_content, page.properties) end |
Instance Method Details
#render(locals = {}) ⇒ Object
Apply layouts and the liquid templating language.
13 14 15 |
# File 'lib/laze/renderers/page_renderer.rb', line 13 def render(locals = {}) liquify(wrap_in_layout(string), ([:locals] || {}).merge(locals)) end |