Class: Usmu::Template::Page
- Inherits:
-
Layout
- Object
- StaticFile
- Layout
- Usmu::Template::Page
- Defined in:
- lib/usmu/template/page.rb
Overview
Represents a page in the source directory of the website.
Instance Attribute Summary collapse
-
#content_path ⇒ string
readonly
protected
Returns the base path to the files used by this class.
Attributes inherited from Layout
#helpers, #input_path, #metadata, #output_extension, #output_filename, #parent, #provider_name, #template_class, #type
Attributes inherited from StaticFile
#input_path, #name, #output_filename
Instance Method Summary collapse
-
#initialize(configuration, name, metadata, type = nil, content = nil) ⇒ Page
constructor
A new instance of Page.
Methods inherited from Layout
#[], #[]=, #add_template_defaults, find_layout, #get_variables, is_valid_file?, #render, search_layout
Methods inherited from StaticFile
Constructor Details
#initialize(configuration, name, metadata, type = nil, content = nil) ⇒ Page
Returns a new instance of Page.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/usmu/template/page.rb', line 13 def initialize(configuration, name, , type = nil, content = nil) super(configuration, name, , type, content) current_parent = parent until current_parent.nil? @log.debug("Injecting page #{name} into #{current_parent.name}") current_parent['page'] = self current_parent = current_parent.parent end end |
Instance Attribute Details
#content_path ⇒ string (readonly, protected)
Returns the base path to the files used by this class.
This folder should be the parent folder for the file named by the name attribute.
34 35 36 |
# File 'lib/usmu/template/page.rb', line 34 def content_path @configuration.source_path end |