class Middleman::Sitemap::ProxyResource
def content_type
def content_type mime_type = super return mime_type if mime_type target_resource.content_type end
def initialize(store, path, target)
-
source_file
(String
) -- -
path
(String
) -- -
store
(Middleman::Sitemap::Store
) --
def initialize(store, path, target) super(store, path) target = ::Middleman::Util.normalize_path(target) raise "You can't proxy #{path} to itself!" if target == path @target = target end
def source_file
def source_file target_resource.source_file end
def target_resource
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