Class: Dimples::Page
Overview
A single page on a site.
Constant Summary
Constants inherited from Entry
Instance Attribute Summary
Attributes inherited from Entry
#contents, #metadata, #path, #rendered_contents
Instance Method Summary collapse
-
#initialize(site:, path:) ⇒ Page
constructor
A new instance of Page.
- #output_directory ⇒ Object
Methods inherited from Entry
#generate, #method_missing, #parse_metadata, #render, #respond_to_missing?, #template, #to_h, #url, #write
Constructor Details
#initialize(site:, path:) ⇒ Page
Returns a new instance of Page.
6 7 8 |
# File 'lib/dimples/page.rb', line 6 def initialize(site:, path:) super(site: site, source: Pathname.new(path)) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Dimples::Entry
Instance Method Details
#output_directory ⇒ Object
10 11 12 13 14 15 |
# File 'lib/dimples/page.rb', line 10 def output_directory @output_directory ||= File.dirname(@path).gsub( @site.config.source_paths[:pages], @site.config.build_paths[:root] ).concat('/') end |