diff --git a/middleman-core/features/frontmatter_page_settings.feature b/middleman-core/features/frontmatter_page_settings.feature index f9f3ec94..0e71bd9b 100644 --- a/middleman-core/features/frontmatter_page_settings.feature +++ b/middleman-core/features/frontmatter_page_settings.feature @@ -6,7 +6,7 @@ Feature: Setting page settings through frontmatter And the file "build/alternate_layout.html" should contain "Alternate layout" And the following files should not exist: | build/ignored.html | - + Scenario: Setting layout, ignoring, and disabling directory indexes through frontmatter (preview) Given the Server is running at "frontmatter-settings-app" When I go to "/alternate_layout.html" @@ -31,3 +31,13 @@ Feature: Setting page settings through frontmatter """ When I go to "/ignored.html" Then I should see "This file is no longer ignored." + + Scenario: Overriding layout through frontmatter + Given the Server is running at "frontmatter-settings-app" + When I go to "/override_layout.html" + Then I should see "Layout in use: Override" + + Scenario: Setting layout through frontmatter even if page is mentioned in config + Given the Server is running at "frontmatter-settings-app" + When I go to "/page_mentioned.html" + Then I should see "Layout in use: Override" diff --git a/middleman-core/fixtures/frontmatter-settings-app/config.rb b/middleman-core/fixtures/frontmatter-settings-app/config.rb index 6ec38e93..d5008000 100644 --- a/middleman-core/fixtures/frontmatter-settings-app/config.rb +++ b/middleman-core/fixtures/frontmatter-settings-app/config.rb @@ -1,2 +1,4 @@ # Proxy ignored.html, which should ignore itself through a frontmatter -page 'proxied.html', :proxy => 'ignored.html' \ No newline at end of file +page 'proxied.html', :proxy => 'ignored.html' +page 'override_layout.html', :layout => :alternate +page 'page_mentioned.html' \ No newline at end of file diff --git a/middleman-core/fixtures/frontmatter-settings-app/source/layouts/override.erb b/middleman-core/fixtures/frontmatter-settings-app/source/layouts/override.erb new file mode 100644 index 00000000..fcf39dc0 --- /dev/null +++ b/middleman-core/fixtures/frontmatter-settings-app/source/layouts/override.erb @@ -0,0 +1,2 @@ +<%= yield %> + Override. \ No newline at end of file diff --git a/middleman-core/fixtures/frontmatter-settings-app/source/override_layout.html.erb b/middleman-core/fixtures/frontmatter-settings-app/source/override_layout.html.erb new file mode 100644 index 00000000..a3f3e5ac --- /dev/null +++ b/middleman-core/fixtures/frontmatter-settings-app/source/override_layout.html.erb @@ -0,0 +1,4 @@ +--- +layout: override +--- +Layout in use: \ No newline at end of file diff --git a/middleman-core/fixtures/frontmatter-settings-app/source/page_mentioned.html.erb b/middleman-core/fixtures/frontmatter-settings-app/source/page_mentioned.html.erb new file mode 100644 index 00000000..a3f3e5ac --- /dev/null +++ b/middleman-core/fixtures/frontmatter-settings-app/source/page_mentioned.html.erb @@ -0,0 +1,4 @@ +--- +layout: override +--- +Layout in use: \ No newline at end of file