Merge branch 'master' of github.com:middleman/middleman
This commit is contained in:
commit
be5fad55ca
2 changed files with 2 additions and 7 deletions
|
@ -183,7 +183,7 @@ class Middleman::CoreExtensions::Internationalization < ::Middleman::Extension
|
||||||
File.join(prefix, path.sub(page_id, localized_page_id))
|
File.join(prefix, path.sub(page_id, localized_page_id))
|
||||||
)
|
)
|
||||||
|
|
||||||
path.gsub!(options[:templates_dir] + '/', '')
|
path = path.sub(options[:templates_dir] + '/', '')
|
||||||
|
|
||||||
@_localization_data[path] = [lang, path, localized_page_id]
|
@_localization_data[path] = [lang, path, localized_page_id]
|
||||||
|
|
||||||
|
|
|
@ -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…
Reference in a new issue