Put back request_path, I get it now
This commit is contained in:
parent
b0ea4e7608
commit
2beb774eb9
3 changed files with 10 additions and 4 deletions
|
@ -254,7 +254,7 @@ module Middleman::Cli
|
||||||
FileUtils.cp(resource.source_file, output_file)
|
FileUtils.cp(resource.source_file, output_file)
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
response = @rack.get(URI.escape(resource.destination_path))
|
response = @rack.get(URI.escape(resource.request_path))
|
||||||
|
|
||||||
if response.status == 200
|
if response.status == 200
|
||||||
base.create_file(output_file, binary_encode(response.body))
|
base.create_file(output_file, binary_encode(response.body))
|
||||||
|
|
|
@ -49,12 +49,13 @@ module Middleman
|
||||||
class EndpointResource < ::Middleman::Sitemap::Resource
|
class EndpointResource < ::Middleman::Sitemap::Resource
|
||||||
attr_accessor :output
|
attr_accessor :output
|
||||||
|
|
||||||
def initialize(store, path, source_file)
|
def initialize(store, path, request_path)
|
||||||
@request_path = ::Middleman::Util.normalize_path(source_file)
|
|
||||||
|
|
||||||
super(store, path)
|
super(store, path)
|
||||||
|
@request_path = ::Middleman::Util.normalize_path(request_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
attr_reader :request_path
|
||||||
|
|
||||||
def template?
|
def template?
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
|
@ -20,6 +20,11 @@ module Middleman
|
||||||
# @return [String]
|
# @return [String]
|
||||||
attr_accessor :destination_path
|
attr_accessor :destination_path
|
||||||
|
|
||||||
|
# The path to use when requesting this resource. Normally it's
|
||||||
|
# the same as {#destination_path} but it can be overridden in subclasses.
|
||||||
|
# @return [String]
|
||||||
|
alias_method :request_path, :destination_path
|
||||||
|
|
||||||
# Set the on-disk source file for this resource
|
# Set the on-disk source file for this resource
|
||||||
# @return [String]
|
# @return [String]
|
||||||
def source_file
|
def source_file
|
||||||
|
|
Loading…
Reference in a new issue