From d53bac226e8b02b132c7a2b065b3c339d7c51edc Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Thu, 21 Jul 2011 16:55:18 -0700 Subject: [PATCH] allow page blocks to add instance vars --- lib/middleman/core_extensions/routing.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/middleman/core_extensions/routing.rb b/lib/middleman/core_extensions/routing.rb index 485425e3..0ec88937 100644 --- a/lib/middleman/core_extensions/routing.rb +++ b/lib/middleman/core_extensions/routing.rb @@ -48,9 +48,11 @@ module Middleman::CoreExtensions::Routing options[:layout] = settings.layout if options[:layout].nil? + has_block = block_given? + paths.each do |p| get(p) do - return yield if block_given? + instance_eval(&block) if has_block process_request(options) end end