Sha256: cc32aa6f1c517f787a55b90b093821546cdc364cc530b377f0f1d374ca5b20e2
Contents?: true
Size: 1.02 KB
Versions: 23
Compression:
Stored size: 1.02 KB
Contents
module Sitepress module BuildPaths # 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`. class RootPath attr_reader :resource extend Forwardable def_delegators :resource, :node, :format def initialize(resource) @resource = resource end def filename if format.nil? filename_without_format elsif format == node.default_format filename_with_default_format elsif format filename_with_format end end def path File.join(*resource.lineage, filename) end protected def filename_without_format node.default_name end def filename_with_format "#{node.default_name}.#{format}" end def filename_with_default_format filename_with_format end end end end
Version data entries
23 entries across 23 versions & 1 rubygems