Sha256: 257e778a913eeab7e8b55f1e920520e705f6bfea98933c55ae28239c7aa33de1
Contents?: true
Size: 707 Bytes
Versions: 16
Compression:
Stored size: 707 Bytes
Contents
module Sitepress module Extensions # Removes files beginning with "_" from the resource collection. class IndexRequestPath # Name of the file that we'll want to change to a / path FILE_NAME = "index.html".freeze def initialize(file_name: FILE_NAME) @file_name = file_name end def process_resources(node) node.flatten.each do |r| asset = r.asset if asset.path.basename.to_s.start_with? @file_name request_path = Pathname.new("/").join(r.request_path).dirname.cleanpath.to_s node.formats.remove(r) node.add(path: request_path, asset: asset) end end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems