From b01f0f96e884f7e99557c1ade646d047f96a6d5f Mon Sep 17 00:00:00 2001 From: Ben Hollis Date: Fri, 6 Jan 2012 23:03:08 -0800 Subject: [PATCH] New (failing) feature describing what it would look like to set some page features through frontmatter. This tests the ability to set layout, ignore, and diable directory_index. Pertains to issue #194. --- .../features/frontmatter_page_settings.feature | 10 ++++++++++ .../fixtures/frontmatter-settings-app/config.rb | 4 ++++ .../frontmatter-settings-app/source/alternate.erb | 3 +++ .../source/alternate_layout.html.erb | 5 +++++ .../frontmatter-settings-app/source/ignored.html.erb | 5 +++++ .../frontmatter-settings-app/source/no_index.html.erb | 5 +++++ 6 files changed, 32 insertions(+) create mode 100644 middleman-core/features/frontmatter_page_settings.feature create mode 100644 middleman-core/fixtures/frontmatter-settings-app/config.rb create mode 100644 middleman-core/fixtures/frontmatter-settings-app/source/alternate.erb create mode 100644 middleman-core/fixtures/frontmatter-settings-app/source/alternate_layout.html.erb create mode 100644 middleman-core/fixtures/frontmatter-settings-app/source/ignored.html.erb create mode 100644 middleman-core/fixtures/frontmatter-settings-app/source/no_index.html.erb diff --git a/middleman-core/features/frontmatter_page_settings.feature b/middleman-core/features/frontmatter_page_settings.feature new file mode 100644 index 00000000..b2c7667f --- /dev/null +++ b/middleman-core/features/frontmatter_page_settings.feature @@ -0,0 +1,10 @@ +Feature: Setting page settings through frontmatter + Scenario: Setting layout, ignoring, and disabling directory indexes through frontmatter + Given a successfully built app at "frontmatter-settings-app" + Then the following files should exist: + | build/proxied/index.html | + | build/no_index.html | + And the file "build/alternate_layout/index.html" should contain "Alternate layout" + And the following files should not exist: + | build/ignored/index.html | + | build/no_index/index.html | diff --git a/middleman-core/fixtures/frontmatter-settings-app/config.rb b/middleman-core/fixtures/frontmatter-settings-app/config.rb new file mode 100644 index 00000000..3c393758 --- /dev/null +++ b/middleman-core/fixtures/frontmatter-settings-app/config.rb @@ -0,0 +1,4 @@ +activate :directory_indexes + +# Proxy ignored.html, which should ignore itself through a frontmatter +page 'proxied.html', :proxy => 'ignored.html' diff --git a/middleman-core/fixtures/frontmatter-settings-app/source/alternate.erb b/middleman-core/fixtures/frontmatter-settings-app/source/alternate.erb new file mode 100644 index 00000000..a38f2d07 --- /dev/null +++ b/middleman-core/fixtures/frontmatter-settings-app/source/alternate.erb @@ -0,0 +1,3 @@ +Alternate layout! + +<%= yield %> \ No newline at end of file diff --git a/middleman-core/fixtures/frontmatter-settings-app/source/alternate_layout.html.erb b/middleman-core/fixtures/frontmatter-settings-app/source/alternate_layout.html.erb new file mode 100644 index 00000000..c385be0d --- /dev/null +++ b/middleman-core/fixtures/frontmatter-settings-app/source/alternate_layout.html.erb @@ -0,0 +1,5 @@ +--- +layout: alternate +--- + +This uses an alternate layout diff --git a/middleman-core/fixtures/frontmatter-settings-app/source/ignored.html.erb b/middleman-core/fixtures/frontmatter-settings-app/source/ignored.html.erb new file mode 100644 index 00000000..a2c04fe3 --- /dev/null +++ b/middleman-core/fixtures/frontmatter-settings-app/source/ignored.html.erb @@ -0,0 +1,5 @@ +--- +ignored: true +--- + +This file ignores itself! But it can still be proxied. diff --git a/middleman-core/fixtures/frontmatter-settings-app/source/no_index.html.erb b/middleman-core/fixtures/frontmatter-settings-app/source/no_index.html.erb new file mode 100644 index 00000000..55eaaaf8 --- /dev/null +++ b/middleman-core/fixtures/frontmatter-settings-app/source/no_index.html.erb @@ -0,0 +1,5 @@ +--- +directory_index: false +--- + +This should not be put in no_index/index.html - it goes to no_index.html