Class: Renderer
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(content) ⇒ Renderer
constructor
A new instance of Renderer.
- #render ⇒ Object
- #write_to_site ⇒ Object
Methods included from Configuration
#config, config, #defaultLinks, defaultLinks, links_file_path, read_config, read_configuration, read_default_links, valid_location?
Constructor Details
#initialize(content) ⇒ Renderer
Returns a new instance of Renderer.
9 10 11 |
# File 'lib/renderer.rb', line 9 def initialize content @content = content end |
Instance Method Details
#render ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/renderer.rb', line 13 def render if has_layout? render_layout else render_content end end |
#write_to_site ⇒ Object
21 22 23 24 25 |
# File 'lib/renderer.rb', line 21 def write_to_site out = File.join config['path'], '_site', @content.url FileUtils.mkdir_p File.dirname out write_to out end |