Skip to content

Commit

Permalink
Merge pull request #4373 from jekyll/page-as-renderable
Browse files Browse the repository at this point in the history
Merge pull request 4373
  • Loading branch information
jekyllbot committed Jan 18, 2016
2 parents 9676b77 + 4de1873 commit c5830ce
Show file tree
Hide file tree
Showing 33 changed files with 463 additions and 242 deletions.
33 changes: 22 additions & 11 deletions features/collections.feature
Expand Up @@ -8,7 +8,8 @@ Feature: Collections
And I have fixture collections
And I have a configuration file with "collections" set to "['methods']"
When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And I should see "Collections: <p>Use <code class=\"highlighter-rouge\">Jekyll.configuration</code> to build a full configuration for use w/Jekyll.</p>\n\n<p>Whatever: foo.bar</p>\n<p>Signs are nice</p>\n<p><code class=\"highlighter-rouge\">Jekyll.sanitized_path</code> is used to make sure your path is in your source.</p>\n<p>Run your generators! default</p>\n<p>Page without title.</p>\n<p>Run your generators! default</p>" in "_site/index.html"
And the "_site/methods/configuration.html" file should not exist

Expand All @@ -24,7 +25,8 @@ Feature: Collections
foo: bar
"""
When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And I should see "Collections: output => true" in "_site/index.html"
And I should see "label => methods" in "_site/index.html"
And I should see "Methods metadata: bar" in "_site/collection_metadata.html"
Expand All @@ -41,7 +43,8 @@ Feature: Collections
permalink: /:collection/:path/
"""
When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And I should see "<p>Whatever: foo.bar</p>" in "_site/methods/configuration/index.html"

Scenario: Rendered document in a layout
Expand All @@ -56,7 +59,8 @@ Feature: Collections
foo: bar
"""
When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And I should see "Collections: output => true" in "_site/index.html"
And I should see "label => methods" in "_site/index.html"
And I should see "foo => bar" in "_site/index.html"
Expand All @@ -72,7 +76,8 @@ Feature: Collections
- methods
"""
When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And I should see "Collections: _methods/configuration.md _methods/escape-\+ #%20\[\].md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html"

Scenario: Collections specified as an hash
Expand All @@ -84,7 +89,8 @@ Feature: Collections
- methods
"""
When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And I should see "Collections: _methods/configuration.md _methods/escape-\+ #%20\[\].md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html"

Scenario: All the documents
Expand All @@ -96,7 +102,8 @@ Feature: Collections
- methods
"""
When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And I should see "All documents: _methods/configuration.md _methods/escape-\+ #%20\[\].md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html"

Scenario: Documents have an output attribute, which is the converted HTML
Expand All @@ -108,7 +115,8 @@ Feature: Collections
- methods
"""
When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And I should see "First document's output: <p>Use <code class=\"highlighter-rouge\">Jekyll.configuration</code> to build a full configuration for use w/Jekyll.</p>\n\n<p>Whatever: foo.bar</p>" in "_site/index.html"

Scenario: Filter documents by where
Expand All @@ -120,7 +128,8 @@ Feature: Collections
- methods
"""
When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And I should see "Item count: 2" in "_site/index.html"

Scenario: Sort by title
Expand All @@ -132,7 +141,8 @@ Feature: Collections
- methods
"""
When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And I should see "1. of 7: <p>Page without title.</p>" in "_site/index.html"

Scenario: Sort by relative_path
Expand All @@ -144,5 +154,6 @@ Feature: Collections
- methods
"""
When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And I should see "Collections: Jekyll.configuration, Jekyll.escape, Jekyll.sanitized_path, Site#generate, , Site#generate," in "_site/index.html"
48 changes: 32 additions & 16 deletions features/create_sites.feature
Expand Up @@ -13,7 +13,8 @@ Feature: Create sites
Scenario: Basic site
Given I have an "index.html" file that contains "Basic Site"
When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And I should see "Basic Site" in "_site/index.html"

Scenario: Basic site with a post
Expand All @@ -22,15 +23,17 @@ Feature: Create sites
| title | date | content |
| Hackers | 2009-03-27 | My First Exploit |
When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And I should see "My First Exploit" in "_site/2009/03/27/hackers.html"

Scenario: Basic site with layout and a page
Given I have a _layouts directory
And I have an "index.html" page with layout "default" that contains "Basic Site with Layout"
And I have a default layout that contains "Page Layout: {{ content }}"
When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And I should see "Page Layout: Basic Site with Layout" in "_site/index.html"

Scenario: Basic site with layout and a post
Expand All @@ -41,7 +44,8 @@ Feature: Create sites
| Wargames | 2009-03-27 | default | The only winning move is not to play. |
And I have a default layout that contains "Post Layout: {{ content }}"
When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And I should see "Post Layout: <p>The only winning move is not to play.</p>" in "_site/2009/03/27/wargames.html"

Scenario: Basic site with layout inside a subfolder and a post
Expand All @@ -52,7 +56,8 @@ Feature: Create sites
| Wargames | 2009-03-27 | post/simple | The only winning move is not to play. |
And I have a post/simple layout that contains "Post Layout: {{ content }}"
When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And I should see "Post Layout: <p>The only winning move is not to play.</p>" in "_site/2009/03/27/wargames.html"

Scenario: Basic site with layouts, pages, posts and files
Expand All @@ -75,7 +80,8 @@ Feature: Create sites
| entry3 | 2009-05-27 | post | content for entry3. |
| entry4 | 2009-06-27 | post | content for entry4. |
When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And I should see "Page : Site contains 2 pages and 4 posts" in "_site/index.html"
And I should see "No replacement \{\{ site.posts.size \}\}" in "_site/about.html"
And I should see "" in "_site/another_file"
Expand All @@ -90,7 +96,8 @@ Feature: Create sites
And I have an "index.html" page that contains "Basic Site with include tag: {% include about.textile %}"
And I have an "_includes/about.textile" file that contains "Generated by Jekyll"
When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And I should see "Basic Site with include tag: Generated by Jekyll" in "_site/index.html"

Scenario: Basic site with subdir include tag
Expand All @@ -99,7 +106,8 @@ Feature: Create sites
And I have an info directory
And I have an "info/index.html" page that contains "Basic Site with subdir include tag: {% include about.textile %}"
When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And I should see "Basic Site with subdir include tag: Generated by Jekyll" in "_site/info/index.html"

Scenario: Basic site with nested include tag
Expand All @@ -108,7 +116,8 @@ Feature: Create sites
And I have an "_includes/jekyll.textile" file that contains "Jekyll"
And I have an "index.html" page that contains "Basic Site with include tag: {% include about.textile %}"
When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And I should see "Basic Site with include tag: Generated by Jekyll" in "_site/index.html"

Scenario: Basic site with internal post linking
Expand All @@ -120,19 +129,22 @@ Feature: Create sites
| entry1 | 2007-12-31 | post | content for entry1. |
| entry2 | 2008-01-01 | post | content for entry2. |
When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And I should see "URL: /2008/01/01/entry2/" in "_site/index.html"

Scenario: Basic site with whitelisted dotfile
Given I have an ".htaccess" file that contains "SomeDirective"
When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And I should see "SomeDirective" in "_site/.htaccess"

Scenario: File was replaced by a directory
Given I have a "test" file that contains "some stuff"
When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
When I delete the file "test"
Given I have a test directory
And I have a "test/index.html" file that contains "some other stuff"
Expand All @@ -146,13 +158,15 @@ Feature: Create sites
And I have a "secret.html" page with published "false" that contains "Unpublished page"

When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And the "_site/index.html" file should exist
And the "_site/public.html" file should exist
But the "_site/secret.html" file should not exist

When I run jekyll build --unpublished
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And the "_site/index.html" file should exist
And the "_site/public.html" file should exist
And the "_site/secret.html" file should exist
Expand All @@ -164,9 +178,11 @@ Feature: Create sites
| entry1 | 2020-12-31 | post | content for entry1. |
| entry2 | 2007-12-31 | post | content for entry2. |
When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And I should see "content for entry2" in "_site/2007/12/31/entry2.html"
And the "_site/2020/12/31/entry1.html" file should not exist
When I run jekyll build --future
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And the "_site/2020/12/31/entry1.html" file should exist
12 changes: 8 additions & 4 deletions features/drafts.feature
Expand Up @@ -10,7 +10,8 @@ Feature: Draft Posts
| title | date | layout | content |
| Recipe | 2009-03-27 | default | Not baked yet. |
When I run jekyll build --drafts
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And I should see "Not baked yet." in "_site/recipe.html"

Scenario: Don't preview a draft
Expand All @@ -21,7 +22,8 @@ Feature: Draft Posts
| title | date | layout | content |
| Recipe | 2009-03-27 | default | Not baked yet. |
When I run jekyll build
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And the "_site/recipe.html" file should not exist

Scenario: Don't preview a draft that is not published
Expand All @@ -32,7 +34,8 @@ Feature: Draft Posts
| title | date | layout | published | content |
| Recipe | 2009-03-27 | default | false | Not baked yet. |
When I run jekyll build --drafts
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And the "_site/recipe.html" file should not exist

Scenario: Use page.path variable
Expand All @@ -42,5 +45,6 @@ Feature: Draft Posts
| title | date | layout | content |
| Recipe | 2009-03-27 | simple | Post path: {{ page.path }} |
When I run jekyll build --drafts
Then the _site directory should exist
Then I should get a zero exit status
And the _site directory should exist
And I should see "Post path: _drafts/recipe.markdown" in "_site/recipe.html"

0 comments on commit c5830ce

Please sign in to comment.