Method: Middleman::Sitemap::ProxyResource#target_resource

Defined in:
lib/middleman-core/sitemap/extensions/proxies.rb

#target_resourceObject



85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/middleman-core/sitemap/extensions/proxies.rb', line 85

def target_resource
  resource = @store.find_resource_by_path(@target)

  unless resource
    raise "Path #{path} proxies to unknown file #{@target}:#{@store.resources.map(&:path)}"
  end

  if resource.is_a? ProxyResource
    raise "You can't proxy #{path} to #{@target} which is itself a proxy."
  end

  resource
end