From 70dd18e8f107974a1ad49a88582b6cd0c2b5cfb1 Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Thu, 7 May 2015 09:01:04 -0700 Subject: [PATCH] Attempt fix for #1506 --- middleman-core/lib/middleman-core/core_extensions/rendering.rb | 2 +- middleman-core/lib/middleman-core/meta_pages.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/middleman-core/lib/middleman-core/core_extensions/rendering.rb b/middleman-core/lib/middleman-core/core_extensions/rendering.rb index d2c7d1fd..a5ce0d9a 100644 --- a/middleman-core/lib/middleman-core/core_extensions/rendering.rb +++ b/middleman-core/lib/middleman-core/core_extensions/rendering.rb @@ -300,7 +300,7 @@ module Middleman end # Render using Tilt - content = template.render(context, locs, &block) + content = template.render(context || ::Object.new, locs, &block) # Allow hooks to manipulate the result after render self.class.callbacks_for_hook(:after_render).each do |callback| diff --git a/middleman-core/lib/middleman-core/meta_pages.rb b/middleman-core/lib/middleman-core/meta_pages.rb index 8e1a68a7..79c3ed07 100644 --- a/middleman-core/lib/middleman-core/meta_pages.rb +++ b/middleman-core/lib/middleman-core/meta_pages.rb @@ -90,7 +90,7 @@ module Middleman # Render a template with the given name and locals def template(template_name, locals={}) template_path = File.join(File.dirname(__FILE__), 'meta_pages', 'templates', template_name) - content = Tilt.new(template_path).render(nil, locals) + content = Tilt.new(template_path).render(::Object.new, locals) response(content) end