Class: Dimples::Sources::Page
Overview
A single page on a site.
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#assign_metadata, #initialize, #parse_metadata, #render, #url_for, #write
Constructor Details
This class inherits a constructor from Dimples::Sources::Base
Instance Method Details
#output_directory ⇒ Object
7 8 9 10 11 12 |
# File 'lib/dimples/sources/page.rb', line 7 def output_directory @output_directory ||= File.dirname(@path).gsub( @site.config.source_paths[:pages], @site.config.build_paths[:root] ).concat('/') end |
#template ⇒ Object
20 21 22 |
# File 'lib/dimples/sources/page.rb', line 20 def template @template ||= Tilt::ERBTemplate.new { @contents } end |
#url ⇒ Object
14 15 16 17 18 |
# File 'lib/dimples/sources/page.rb', line 14 def url super.tap do |url| url.concat(filename) unless filename == 'index.html' end end |