Use alias_method instead of defining an alias method for current_page
This commit is contained in:
parent
7108c29035
commit
b48a767595
1 changed files with 1 additions and 6 deletions
|
@ -37,18 +37,13 @@ module Middleman
|
||||||
@locs[:current_path]
|
@locs[:current_path]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Get the resource object for the current path
|
|
||||||
# @return [Middleman::Sitemap::Resource]
|
|
||||||
def current_page
|
|
||||||
current_resource
|
|
||||||
end
|
|
||||||
|
|
||||||
# Get the resource object for the current path
|
# Get the resource object for the current path
|
||||||
# @return [Middleman::Sitemap::Resource]
|
# @return [Middleman::Sitemap::Resource]
|
||||||
def current_resource
|
def current_resource
|
||||||
return nil unless current_path
|
return nil unless current_path
|
||||||
sitemap.find_resource_by_destination_path(current_path)
|
sitemap.find_resource_by_destination_path(current_path)
|
||||||
end
|
end
|
||||||
|
alias_method :current_page, :current_resource
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue