Class: Sitepress::BuildPaths::RootPath
- Inherits:
-
Object
- Object
- Sitepress::BuildPaths::RootPath
- Extended by:
- Forwardable
- Defined in:
- lib/sitepress/build_paths/root_path.rb
Overview
Compiles pages directly from ‘/pages/blah.html.haml` to `/blah.html`. Handles root `index` pages too, mainly grabbing the root, which doesn’t have a name in the node, to the default_name of the node, which is usually ‘index`.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
- #filename ⇒ Object
-
#initialize(resource) ⇒ RootPath
constructor
A new instance of RootPath.
- #path ⇒ Object
Constructor Details
#initialize(resource) ⇒ RootPath
Returns a new instance of RootPath.
12 13 14 |
# File 'lib/sitepress/build_paths/root_path.rb', line 12 def initialize(resource) @resource = resource end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
7 8 9 |
# File 'lib/sitepress/build_paths/root_path.rb', line 7 def resource @resource end |
Instance Method Details
#filename ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/sitepress/build_paths/root_path.rb', line 16 def filename if format.nil? filename_without_format elsif format == node.default_format filename_with_default_format elsif format filename_with_format end end |
#path ⇒ Object
26 27 28 |
# File 'lib/sitepress/build_paths/root_path.rb', line 26 def path File.join(*resource.lineage, filename) end |