From c5aabbbe4f67772006a1b92377bc1d8969781426 Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Fri, 29 Jan 2016 10:30:08 -0800 Subject: [PATCH] Confirm nested frontmatter doesn't work --- .../features/nested_layouts.feature | 37 ++++++++++--------- .../source/layouts/inner.erb | 7 +++- .../source/layouts/inner_haml.haml | 8 +++- .../source/layouts/inner_slim.slim | 8 +++- .../source/layouts/master.erb | 8 +++- .../source/layouts/master_haml.haml | 6 ++- .../source/layouts/master_slim.slim | 6 ++- .../source/layouts/outer.erb | 8 +++- .../source/layouts/outer_haml.haml | 6 ++- .../source/layouts/outer_slim.slim | 6 ++- 10 files changed, 70 insertions(+), 30 deletions(-) diff --git a/middleman-core/features/nested_layouts.feature b/middleman-core/features/nested_layouts.feature index d70a7e23..f51831fb 100644 --- a/middleman-core/features/nested_layouts.feature +++ b/middleman-core/features/nested_layouts.feature @@ -5,37 +5,37 @@ Feature: Allow nesting of layouts When I go to "/index.html" Then I should see: """ - Master + Master Erb

Index Title

- Outer - Inner + I am Outer + I am Inner Template - + """ When I go to "/another.html" Then I should see: """ - Master + Master Erb

New Article Title

- Outer - Inner + I am Outer + I am Inner

The Article Content

""" - + Scenario: A page uses an inner layout when uses an outer layout (slim) Given the Server is running at "nested-layout-app" When I go to "/slim-test.html" - Then I should see "

Master

New Article Title

Outer

Inner

The Article Content

" - + Then I should see "

Master Slim

New Article Title

I am Outer

I am Inner

The Article Content

" + Scenario: A page uses an inner layout when uses an outer layout (haml) Given the Server is running at "nested-layout-app" When I go to "/haml-test.html" Then I should see: """ - Master + Master Haml

New Article Title

- Outer - Inner + I am Outer + I am Inner

The Article Content

""" @@ -43,13 +43,16 @@ Feature: Allow nesting of layouts Given the Server is running at "nested-layout-app" When I go to "/data-one.html" Then I should see "Page Number One" - And I should see "Inner" + And I should see "Page #1" + And I should see "I am Inner" + And I should see "I am Outer" + And I should see "Master Erb" When I go to "/data-two.html" Then I should see "Page Number Two" - And I should not see "Inner" + And I should not see "I am Inner" When I go to "/data-one.html" Then I should see "Page Number One" - And I should see "Inner" + And I should see "I am Inner" When I go to "/data-two.html" Then I should see "Page Number Two" - And I should not see "Inner" + And I should not see "I am Inner" diff --git a/middleman-core/fixtures/nested-layout-app/source/layouts/inner.erb b/middleman-core/fixtures/nested-layout-app/source/layouts/inner.erb index 62dfc12b..3e29f567 100644 --- a/middleman-core/fixtures/nested-layout-app/source/layouts/inner.erb +++ b/middleman-core/fixtures/nested-layout-app/source/layouts/inner.erb @@ -1,4 +1,7 @@ +--- +inner: true +--- <% wrap_layout :outer do %> - Inner + I am Inner <%= yield %> -<% end %> \ No newline at end of file +<% end %> diff --git a/middleman-core/fixtures/nested-layout-app/source/layouts/inner_haml.haml b/middleman-core/fixtures/nested-layout-app/source/layouts/inner_haml.haml index a8c1938d..5f99da1e 100644 --- a/middleman-core/fixtures/nested-layout-app/source/layouts/inner_haml.haml +++ b/middleman-core/fixtures/nested-layout-app/source/layouts/inner_haml.haml @@ -1,3 +1,7 @@ +--- +inner_haml: true +--- + = wrap_layout :outer_haml do - Inner - = yield \ No newline at end of file + I am Inner + = yield diff --git a/middleman-core/fixtures/nested-layout-app/source/layouts/inner_slim.slim b/middleman-core/fixtures/nested-layout-app/source/layouts/inner_slim.slim index 49f1ab6f..f7d9c924 100644 --- a/middleman-core/fixtures/nested-layout-app/source/layouts/inner_slim.slim +++ b/middleman-core/fixtures/nested-layout-app/source/layouts/inner_slim.slim @@ -1,3 +1,7 @@ +--- +inner_slim: true +--- + = wrap_layout :outer_slim do - h3 Inner - == yield \ No newline at end of file + h3 I am Inner + == yield diff --git a/middleman-core/fixtures/nested-layout-app/source/layouts/master.erb b/middleman-core/fixtures/nested-layout-app/source/layouts/master.erb index 7bd170af..fc862aa4 100644 --- a/middleman-core/fixtures/nested-layout-app/source/layouts/master.erb +++ b/middleman-core/fixtures/nested-layout-app/source/layouts/master.erb @@ -1,3 +1,9 @@ -Master +--- +master: true +--- + +Master Erb

<%= current_page.data.title %>

<%= yield %> + +Using Inner: <%= current_page.data.inner ? 'true' : 'false' %> diff --git a/middleman-core/fixtures/nested-layout-app/source/layouts/master_haml.haml b/middleman-core/fixtures/nested-layout-app/source/layouts/master_haml.haml index 273f21e7..3c949d5c 100644 --- a/middleman-core/fixtures/nested-layout-app/source/layouts/master_haml.haml +++ b/middleman-core/fixtures/nested-layout-app/source/layouts/master_haml.haml @@ -1,3 +1,7 @@ -Master +--- +master_haml: true +--- + +Master Haml %h1= current_page.data.title = yield diff --git a/middleman-core/fixtures/nested-layout-app/source/layouts/master_slim.slim b/middleman-core/fixtures/nested-layout-app/source/layouts/master_slim.slim index 4ade5748..cd5eac1d 100644 --- a/middleman-core/fixtures/nested-layout-app/source/layouts/master_slim.slim +++ b/middleman-core/fixtures/nested-layout-app/source/layouts/master_slim.slim @@ -1,3 +1,7 @@ -h1 Master +--- +master_slim: true +--- + +h1 Master Slim p== current_page.data.title div== yield diff --git a/middleman-core/fixtures/nested-layout-app/source/layouts/outer.erb b/middleman-core/fixtures/nested-layout-app/source/layouts/outer.erb index 643d8efc..adc4f9e2 100644 --- a/middleman-core/fixtures/nested-layout-app/source/layouts/outer.erb +++ b/middleman-core/fixtures/nested-layout-app/source/layouts/outer.erb @@ -1,4 +1,8 @@ +--- +outer: true +--- + <% wrap_layout :master do %> - Outer + I am Outer <%= yield %> -<% end %> \ No newline at end of file +<% end %> diff --git a/middleman-core/fixtures/nested-layout-app/source/layouts/outer_haml.haml b/middleman-core/fixtures/nested-layout-app/source/layouts/outer_haml.haml index eaf1671f..d6d4b05b 100644 --- a/middleman-core/fixtures/nested-layout-app/source/layouts/outer_haml.haml +++ b/middleman-core/fixtures/nested-layout-app/source/layouts/outer_haml.haml @@ -1,3 +1,7 @@ +--- +outer_haml: true +--- + = wrap_layout :master_haml do - Outer + I am Outer = yield diff --git a/middleman-core/fixtures/nested-layout-app/source/layouts/outer_slim.slim b/middleman-core/fixtures/nested-layout-app/source/layouts/outer_slim.slim index 0c17185b..65eb3277 100644 --- a/middleman-core/fixtures/nested-layout-app/source/layouts/outer_slim.slim +++ b/middleman-core/fixtures/nested-layout-app/source/layouts/outer_slim.slim @@ -1,3 +1,7 @@ +--- +outer_slim: true +--- + = wrap_layout :master_slim do - h2 Outer + h2 I am Outer == yield