From c3492b1f7b5cc7534c7a0aeffdbfb2a7814a9ccc Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Sun, 24 Aug 2014 14:38:06 -0700 Subject: [PATCH] Fix partial lookup --- middleman-core/lib/middleman-core/template_context.rb | 2 +- .../lib/middleman-core/util/hash_with_indifferent_access.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/middleman-core/lib/middleman-core/template_context.rb b/middleman-core/lib/middleman-core/template_context.rb index 921ebc3e..7012e6f9 100644 --- a/middleman-core/lib/middleman-core/template_context.rb +++ b/middleman-core/lib/middleman-core/template_context.rb @@ -124,7 +124,7 @@ module Middleman # @return [String] Contract String => Maybe[IsA['Middleman::SourceFile']] def locate_partial(partial_path) - return unless resource = sitemap.find_resource_by_path(current_path) + return unless resource = sitemap.find_resource_by_destination_path(current_path) # Look for partials relative to the current path current_dir = resource.source_file[:relative_path].dirname diff --git a/middleman-core/lib/middleman-core/util/hash_with_indifferent_access.rb b/middleman-core/lib/middleman-core/util/hash_with_indifferent_access.rb index d9bec962..7dd11845 100644 --- a/middleman-core/lib/middleman-core/util/hash_with_indifferent_access.rb +++ b/middleman-core/lib/middleman-core/util/hash_with_indifferent_access.rb @@ -92,7 +92,7 @@ module Middleman self.class.new(data) elsif data.is_a? Array data.map(&method(:recursively_enhance)).freeze - elsif data.frozen? || data.nil? + elsif data.frozen? || data.nil? || [::TrueClass, ::FalseClass].include?(data.class) data else data.dup.freeze