diff --git a/middleman-core/lib/middleman-core/core_extensions/i18n.rb b/middleman-core/lib/middleman-core/core_extensions/i18n.rb index bf7033b3..e83f7cfc 100644 --- a/middleman-core/lib/middleman-core/core_extensions/i18n.rb +++ b/middleman-core/lib/middleman-core/core_extensions/i18n.rb @@ -183,7 +183,7 @@ class Middleman::CoreExtensions::Internationalization < ::Middleman::Extension 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] diff --git a/middleman-core/lib/middleman-core/sitemap.rb b/middleman-core/lib/middleman-core/sitemap.rb index 3a66cebb..c320369c 100644 --- a/middleman-core/lib/middleman-core/sitemap.rb +++ b/middleman-core/lib/middleman-core/sitemap.rb @@ -37,18 +37,13 @@ module Middleman @locs[:current_path] 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 # @return [Middleman::Sitemap::Resource] def current_resource return nil unless current_path sitemap.find_resource_by_destination_path(current_path) end + alias_method :current_page, :current_resource end end end