class Middleman::Sitemap::Store

def file_to_path(file)

Returns:
  • (String) -

Parameters:
  • file (String) --
def file_to_path(file)
  file = File.expand_path(file, @app.root)
  prefix = @app.source_dir.sub(/\/$/, "") + "/"
  return false unless file.start_with?(prefix)
  path = file.sub(prefix, "")
  # Replace a file name containing automatic_directory_matcher with a folder
  unless @app.automatic_directory_matcher.nil?
    path = path.gsub(@app.automatic_directory_matcher, "/")
  end
  extensionless_path(path)
end