class Middleman::Application

def full_path(path)

Returns:
  • (String) - Path with index file if necessary

Parameters:
  • path (String) -- Request path

Other tags:
    Private: -
def full_path(path)
  resource = sitemap.find_resource_by_destination_path(path)
  if !resource
    # Try it with /index.html at the end
    indexed_path = File.join(path.sub(%r{/$}, ''), index_file)
    resource = sitemap.find_resource_by_destination_path(indexed_path)
  end
  if resource
    '/' + resource.destination_path
  else
    '/' + Middleman::Util.normalize_path(path)
  end
end