A minor simplification of Sitemap::Store#path - it can no longer take a block
This commit is contained in:
parent
2dd8531eb5
commit
1fc97d9d7b
|
@ -47,18 +47,16 @@ module Middleman::Sitemap
|
||||||
# @param [String] target
|
# @param [String] target
|
||||||
# @return [void]
|
# @return [void]
|
||||||
def proxy(path, target)
|
def proxy(path, target)
|
||||||
page(path) { proxy_to(target.sub(%r{^/}, "")) }
|
page(path).proxy_to(target.sub(%r{^/}, ""))
|
||||||
app.cache.remove(:proxied_paths)
|
app.cache.remove(:proxied_paths)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Get a page instance for a given path
|
# Get a page instance for a given path
|
||||||
# @param [String] path
|
# @param [String] path
|
||||||
# @return [Middleman::Sitemap::Page]
|
# @return [Middleman::Sitemap::Page]
|
||||||
def page(path, &block)
|
def page(path)
|
||||||
path = path.sub(/^\//, "").gsub("%20", " ")
|
path = path.sub(/^\//, "").gsub("%20", " ")
|
||||||
@pages[path] = ::Middleman::Sitemap::Page.new(self, path) unless @pages.has_key?(path)
|
@pages.fetch(path) { @pages[path] = ::Middleman::Sitemap::Page.new(self, path) }
|
||||||
@pages[path].instance_exec(&block) if block_given?
|
|
||||||
@pages[path]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Loop over known pages
|
# Loop over known pages
|
||||||
|
|
Loading…
Reference in a new issue