From 9555266ac1e1e8b59ea2b745e1834276a214cdd4 Mon Sep 17 00:00:00 2001 From: Ben Hollis Date: Sun, 11 Mar 2012 22:49:21 -0700 Subject: [PATCH 1/3] Variables not passed to proxies when they are built. Possibly related to issue #302. --- middleman-core/features/dynamic_pages.feature | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/middleman-core/features/dynamic_pages.feature b/middleman-core/features/dynamic_pages.feature index a0d2dffb..85558332 100644 --- a/middleman-core/features/dynamic_pages.feature +++ b/middleman-core/features/dynamic_pages.feature @@ -85,6 +85,21 @@ Feature: Dynamic Pages Then I should see "I am real: two" Then I should see "Global: I am four glob" Then I should see "All: I am all glob" + + Scenario: Build proxy with variable one + Given a successfully built app at "dynamic-pages-app" + When I cd to "build" + Then the file "fake/one.html" should contain "I am real: one" + Then the file "fake/one.html" should contain "Global: I am one glob" + Then the file "fake/one.html" should contain "All: I am all glob" + + Then the file "fake2/one.html" should contain "I am real: one" + Then the file "fake2/one.html" should contain "Global: I am two glob" + Then the file "fake2/one.html" should contain "All: I am all glob" + + Then the file "fake3/one.html" should contain "I am real: one" + Then the file "fake3/one.html" should contain "Global: I am three glob" + Then the file "fake3/one.html" should contain "All: I am all glob" Scenario: Target ignore Given the Server is running at "dynamic-pages-app" From 6edefe3c68e2fa00e2d8a1c7b99fa1af9646d389 Mon Sep 17 00:00:00 2001 From: Ben Hollis Date: Sun, 11 Mar 2012 23:09:43 -0700 Subject: [PATCH 2/3] Further tweaks that expose another bug - ignore with proxies leads to Not Found errors. Same issue as #302. --- middleman-core/fixtures/dynamic-pages-app/config.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/middleman-core/fixtures/dynamic-pages-app/config.rb b/middleman-core/fixtures/dynamic-pages-app/config.rb index f0b7299d..99c96640 100644 --- a/middleman-core/fixtures/dynamic-pages-app/config.rb +++ b/middleman-core/fixtures/dynamic-pages-app/config.rb @@ -14,16 +14,16 @@ page "target_ignore3.html", :proxy => "should_be_ignored7.html", :ignore => true page "/target_ignore4.html", :proxy => "should_be_ignored8.html", :ignore => true %w(one two).each do |num| - page "/fake/#{num}.html", :proxy => "/real/index.html" do + page "/fake/#{num}.html", :proxy => "/real/index.html", :ignore => true do @num = num end - page "fake2/#{num}.html", :proxy => "/real/index.html" do + page "fake2/#{num}.html", :proxy => "/real/index.html", :ignore => true do @num = num end - page "fake3/#{num}.html", :proxy => "real/index.html" do + page "fake3/#{num}.html", :proxy => "real/index.html", :ignore => true do @num = num end - page "/fake4/#{num}.html", :proxy => "real/index.html" do + page "/fake4/#{num}.html", :proxy => "real/index.html", :ignore => true do @num = num end end @@ -46,4 +46,4 @@ end page "fake4/*" do @glob_var = "I am four glob" -end \ No newline at end of file +end From c6c3021593525bd4fa690ca80972f4eea512656f Mon Sep 17 00:00:00 2001 From: Ben Hollis Date: Sun, 11 Mar 2012 23:33:46 -0700 Subject: [PATCH 3/3] Fix issue #302 --- middleman-core/lib/middleman-core/sitemap/page.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/middleman-core/lib/middleman-core/sitemap/page.rb b/middleman-core/lib/middleman-core/sitemap/page.rb index 47548cb1..94b91ee3 100644 --- a/middleman-core/lib/middleman-core/sitemap/page.rb +++ b/middleman-core/lib/middleman-core/sitemap/page.rb @@ -42,11 +42,7 @@ module Middleman::Sitemap # Internal path to be requested when rendering this page # @return [String] def request_path - if proxy? - store.page(proxied_to).destination_path - else - destination_path - end + destination_path end # Set the on-disk source file for this page