Cucumber Features

Expand All

Collapse All

Feature: Collections

As a hacker who likes to structure content
I want to be able to create collections of similar information
And render them

features/collections.feature:6

Scenario: Unrendered collection

  1. Given I have an "index.html" page that contains "Collections: {{ site.methods }}"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have fixture collections
    features/step_definitions/jekyll_steps.rb:135
  3. And I have a configuration file with "collections" set to "['methods']"
    features/step_definitions/jekyll_steps.rb:112
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "Collections: <p>Use <code>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>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"
    features/step_definitions/jekyll_steps.rb:187
  7. And the "_site/methods/configuration.html" file should not exist
    features/step_definitions/jekyll_steps.rb:215
features/collections.feature:15

Scenario: Rendered collection

  1. Given I have an "index.html" page that contains "Collections: {{ site.collections }}"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have an "collection_metadata.html" page that contains "Methods metadata: {{ site.collections[0].foo }} {{ site.collections[0] }}"
    features/step_definitions/jekyll_steps.rb:43
  3. And I have fixture collections
    features/step_definitions/jekyll_steps.rb:135
  4. And I have a "_config.yml" file with content:
    features/step_definitions/jekyll_steps.rb:76
    collections:
      methods:
        output: true
        foo:   bar
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "Collections: {\"output\"=>true" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  8. And I should see "\"label\"=>\"methods\"," in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  9. And I should see "Methods metadata: bar" in "_site/collection_metadata.html"
    features/step_definitions/jekyll_steps.rb:187
  10. And I should see "<p>Whatever: foo.bar</p>" in "_site/methods/configuration.html"
    features/step_definitions/jekyll_steps.rb:187
features/collections.feature:33

Scenario: Rendered collection at a custom URL

  1. Given I have an "index.html" page that contains "Collections: {{ site.collections }}"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have fixture collections
    features/step_definitions/jekyll_steps.rb:135
  3. And I have a "_config.yml" file with content:
    features/step_definitions/jekyll_steps.rb:76
    collections:
      methods:
        output: true
        permalink: /:collection/:path/
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "<p>Whatever: foo.bar</p>" in "_site/methods/configuration/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/collections.feature:47

Scenario: Rendered document in a layout

  1. Given I have an "index.html" page that contains "Collections: {{ site.collections }}"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have a default layout that contains "<div class='title'>Tom Preston-Werner</div> {{content}}"
    features/step_definitions/jekyll_steps.rb:60
  3. And I have fixture collections
    features/step_definitions/jekyll_steps.rb:135
  4. And I have a "_config.yml" file with content:
    features/step_definitions/jekyll_steps.rb:76
    collections:
      methods:
        output: true
        foo:   bar
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "Collections: {\"output\"=>true" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  8. And I should see "\"label\"=>\"methods\"," in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  9. And I should see "<p>Run your generators! default</p>" in "_site/methods/site/generate.html"
    features/step_definitions/jekyll_steps.rb:187
  10. And I should see "<div class='title'>Tom Preston-Werner</div>" in "_site/methods/site/generate.html"
    features/step_definitions/jekyll_steps.rb:187
features/collections.feature:65

Scenario: Collections specified as an array

  1. Given I have an "index.html" page that contains "Collections: {% for method in site.methods %}{{ method.relative_path }} {% endfor %}"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have fixture collections
    features/step_definitions/jekyll_steps.rb:135
  3. And I have a "_config.yml" file with content:
    features/step_definitions/jekyll_steps.rb:76
    collections:
    - methods
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. 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"
    features/step_definitions/jekyll_steps.rb:187
features/collections.feature:77

Scenario: Collections specified as an hash

  1. Given I have an "index.html" page that contains "Collections: {% for method in site.methods %}{{ method.relative_path }} {% endfor %}"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have fixture collections
    features/step_definitions/jekyll_steps.rb:135
  3. And I have a "_config.yml" file with content:
    features/step_definitions/jekyll_steps.rb:76
    collections:
    - methods
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. 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"
    features/step_definitions/jekyll_steps.rb:187
features/collections.feature:89

Scenario: All the documents

  1. Given I have an "index.html" page that contains "All documents: {% for doc in site.documents %}{{ doc.relative_path }} {% endfor %}"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have fixture collections
    features/step_definitions/jekyll_steps.rb:135
  3. And I have a "_config.yml" file with content:
    features/step_definitions/jekyll_steps.rb:76
    collections:
    - methods
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. 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"
    features/step_definitions/jekyll_steps.rb:187
features/collections.feature:101

Scenario: Documents have an output attribute, which is the converted HTML

  1. Given I have an "index.html" page that contains "First document's output: {{ site.documents.first.output }}"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have fixture collections
    features/step_definitions/jekyll_steps.rb:135
  3. And I have a "_config.yml" file with content:
    features/step_definitions/jekyll_steps.rb:76
    collections:
    - methods
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "First document's output: <p>Use <code>Jekyll.configuration</code> to build a full configuration for use w/Jekyll.</p>\n\n<p>Whatever: foo.bar</p>" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/collections.feature:113

Scenario: Filter documents by where

  1. Given I have an "index.html" page that contains "{% assign items = site.methods | where: 'whatever','foo.bar' %}Item count: {{ items.size }}"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have fixture collections
    features/step_definitions/jekyll_steps.rb:135
  3. And I have a "_config.yml" file with content:
    features/step_definitions/jekyll_steps.rb:76
    collections:
    - methods
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "Item count: 2" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/collections.feature:125

Scenario: Sort by title

  1. Given I have an "index.html" page that contains "{% assign items = site.methods | sort: 'title' %}1. of {{ items.size }}: {{ items.first.output }}"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have fixture collections
    features/step_definitions/jekyll_steps.rb:135
  3. And I have a "_config.yml" file with content:
    features/step_definitions/jekyll_steps.rb:76
    collections:
    - methods
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "1. of 7: <p>Page without title.</p>" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/collections.feature:137

Scenario: Sort by relative_path

  1. Given I have an "index.html" page that contains "Collections: {% assign methods = site.methods | sort: 'relative_path' %}{% for method in methods %}{{ method.title }}, {% endfor %}"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have fixture collections
    features/step_definitions/jekyll_steps.rb:135
  3. And I have a "_config.yml" file with content:
    features/step_definitions/jekyll_steps.rb:76
    collections:
    - methods
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "Collections: Jekyll.configuration, Jekyll.escape, Jekyll.sanitized_path, Site#generate, , Site#generate," in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187

Feature: Create sites

As a hacker who likes to blog
I want to be able to make a static site
In order to share my awesome ideas with the interwebs

features/create_sites.feature:6

Scenario: Blank site

  1. Given I do not have a "test_blank" directory
    features/step_definitions/jekyll_steps.rb:38
  2. When I run jekyll new test_blank --blank
    features/step_definitions/jekyll_steps.rb:149
  3. Then the test_blank/_layouts directory should exist
    features/step_definitions/jekyll_steps.rb:179
  4. And the test_blank/_posts directory should exist
    features/step_definitions/jekyll_steps.rb:179
  5. And the "test_blank/index.html" file should exist
    features/step_definitions/jekyll_steps.rb:203
features/create_sites.feature:13

Scenario: Basic site

  1. Given I have an "index.html" file that contains "Basic Site"
    features/step_definitions/jekyll_steps.rb:54
  2. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  3. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  4. And I should see "Basic Site" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/create_sites.feature:19

Scenario: Basic site with a post

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    content
    Hackers
    2009-03-27
    My First Exploit
  3. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  4. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  5. And I should see "My First Exploit" in "_site/2009/03/27/hackers.html"
    features/step_definitions/jekyll_steps.rb:187
features/create_sites.feature:28

Scenario: Basic site with layout and a page

  1. Given I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have an "index.html" page with layout "default" that contains "Basic Site with Layout"
    features/step_definitions/jekyll_steps.rb:43
  3. And I have a default layout that contains "Page Layout: {{ content }}"
    features/step_definitions/jekyll_steps.rb:60
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "Page Layout: Basic Site with Layout" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/create_sites.feature:36

Scenario: Basic site with layout and a post

  1. Given I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    Wargames
    2009-03-27
    default
    The only winning move is not to play.
  4. And I have a default layout that contains "Post Layout: {{ content }}"
    features/step_definitions/jekyll_steps.rb:60
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "Post Layout: <p>The only winning move is not to play.</p>" in "_site/2009/03/27/wargames.html"
    features/step_definitions/jekyll_steps.rb:187
features/create_sites.feature:47

Scenario: Basic site with layout inside a subfolder and a post

  1. Given I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    Wargames
    2009-03-27
    post/simple
    The only winning move is not to play.
  4. And I have a post/simple layout that contains "Post Layout: {{ content }}"
    features/step_definitions/jekyll_steps.rb:60
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "Post Layout: <p>The only winning move is not to play.</p>" in "_site/2009/03/27/wargames.html"
    features/step_definitions/jekyll_steps.rb:187
features/create_sites.feature:58

Scenario: Basic site with layouts, pages, posts and files

  1. Given I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a page layout that contains "Page {{ page.title }}: {{ content }}"
    features/step_definitions/jekyll_steps.rb:60
  3. And I have a post layout that contains "Post {{ page.title }}: {{ content }}"
    features/step_definitions/jekyll_steps.rb:60
  4. And I have an "index.html" page with layout "page" that contains "Site contains {{ site.pages.size }} pages and {{ site.posts.size }} posts"
    features/step_definitions/jekyll_steps.rb:43
  5. And I have a blog directory
    features/step_definitions/jekyll_steps.rb:82
  6. And I have a "blog/index.html" page with layout "page" that contains "blog category index page"
    features/step_definitions/jekyll_steps.rb:43
  7. And I have an "about.html" file that contains "No replacement {{ site.posts.size }}"
    features/step_definitions/jekyll_steps.rb:54
  8. And I have an "another_file" file that contains ""
    features/step_definitions/jekyll_steps.rb:54
  9. And I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  10. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    entry1
    2009-03-27
    post
    content for entry1.
    entry2
    2009-04-27
    post
    content for entry2.
  11. And I have a category/_posts directory
    features/step_definitions/jekyll_steps.rb:82
  12. And I have the following posts in "category":
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    entry3
    2009-05-27
    post
    content for entry3.
    entry4
    2009-06-27
    post
    content for entry4.
  13. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  14. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  15. And I should see "Page : Site contains 2 pages and 4 posts" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  16. And I should see "No replacement \{\{ site.posts.size \}\}" in "_site/about.html"
    features/step_definitions/jekyll_steps.rb:187
  17. And I should see "" in "_site/another_file"
    features/step_definitions/jekyll_steps.rb:187
  18. And I should see "Page : blog category index page" in "_site/blog/index.html"
    features/step_definitions/jekyll_steps.rb:187
  19. And I should see "Post entry1: <p>content for entry1.</p>" in "_site/2009/03/27/entry1.html"
    features/step_definitions/jekyll_steps.rb:187
  20. And I should see "Post entry2: <p>content for entry2.</p>" in "_site/2009/04/27/entry2.html"
    features/step_definitions/jekyll_steps.rb:187
  21. And I should see "Post entry3: <p>content for entry3.</p>" in "_site/category/2009/05/27/entry3.html"
    features/step_definitions/jekyll_steps.rb:187
  22. And I should see "Post entry4: <p>content for entry4.</p>" in "_site/category/2009/06/27/entry4.html"
    features/step_definitions/jekyll_steps.rb:187
features/create_sites.feature:88

Scenario: Basic site with include tag

  1. Given I have a _includes directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have an "index.html" page that contains "Basic Site with include tag: {% include about.textile %}"
    features/step_definitions/jekyll_steps.rb:43
  3. And I have an "_includes/about.textile" file that contains "Generated by Jekyll"
    features/step_definitions/jekyll_steps.rb:54
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "Basic Site with include tag: Generated by Jekyll" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/create_sites.feature:96

Scenario: Basic site with subdir include tag

  1. Given I have a _includes directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have an "_includes/about.textile" file that contains "Generated by Jekyll"
    features/step_definitions/jekyll_steps.rb:54
  3. And I have an info directory
    features/step_definitions/jekyll_steps.rb:82
  4. And I have an "info/index.html" page that contains "Basic Site with subdir include tag: {% include about.textile %}"
    features/step_definitions/jekyll_steps.rb:43
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "Basic Site with subdir include tag: Generated by Jekyll" in "_site/info/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/create_sites.feature:105

Scenario: Basic site with nested include tag

  1. Given I have a _includes directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have an "_includes/about.textile" file that contains "Generated by {% include jekyll.textile %}"
    features/step_definitions/jekyll_steps.rb:54
  3. And I have an "_includes/jekyll.textile" file that contains "Jekyll"
    features/step_definitions/jekyll_steps.rb:54
  4. And I have an "index.html" page that contains "Basic Site with include tag: {% include about.textile %}"
    features/step_definitions/jekyll_steps.rb:43
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "Basic Site with include tag: Generated by Jekyll" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/create_sites.feature:114

Scenario: Basic site with internal post linking

  1. Given I have an "index.html" page that contains "URL: {% post_url 2020-01-31-entry2 %}"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have a configuration file with "permalink" set to "pretty"
    features/step_definitions/jekyll_steps.rb:112
  3. And I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  4. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    entry1
    2007-12-31
    post
    content for entry1.
    entry2
    2020-01-31
    post
    content for entry2.
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "URL: /2020/01/31/entry2/" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/create_sites.feature:126

Scenario: Basic site with whitelisted dotfile

  1. Given I have an ".htaccess" file that contains "SomeDirective"
    features/step_definitions/jekyll_steps.rb:54
  2. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  3. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  4. And I should see "SomeDirective" in "_site/.htaccess"
    features/step_definitions/jekyll_steps.rb:187
features/create_sites.feature:132

Scenario: File was replaced by a directory

  1. Given I have a "test" file that contains "some stuff"
    features/step_definitions/jekyll_steps.rb:54
  2. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  3. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  4. When I delete the file "test"
    features/step_definitions/jekyll_steps.rb:169
  5. Given I have a test directory
    features/step_definitions/jekyll_steps.rb:82
  6. And I have a "test/index.html" file that contains "some other stuff"
    features/step_definitions/jekyll_steps.rb:54
  7. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  8. Then the _site/test directory should exist
    features/step_definitions/jekyll_steps.rb:179
  9. And I should see "some other stuff" in "_site/test/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/create_sites.feature:143

Scenario: Basic site with unpublished page

  1. Given I have an "index.html" page with title "index" that contains "Published page"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have a "public.html" page with published "true" that contains "Explicitly published page"
    features/step_definitions/jekyll_steps.rb:43
  3. And I have a "secret.html" page with published "false" that contains "Unpublished page"
    features/step_definitions/jekyll_steps.rb:43
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And the "_site/index.html" file should exist
    features/step_definitions/jekyll_steps.rb:203
  7. And the "_site/public.html" file should exist
    features/step_definitions/jekyll_steps.rb:203
  8. But the "_site/secret.html" file should not exist
    features/step_definitions/jekyll_steps.rb:215
  9. When I run jekyll build --unpublished
    features/step_definitions/jekyll_steps.rb:149
  10. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  11. And the "_site/index.html" file should exist
    features/step_definitions/jekyll_steps.rb:203
  12. And the "_site/public.html" file should exist
    features/step_definitions/jekyll_steps.rb:203
  13. And the "_site/secret.html" file should exist
    features/step_definitions/jekyll_steps.rb:203

Feature: Data

In order to use well-formatted data in my blog
As a blog's user
I want to use _data directory in my site

features/data.feature:6

Scenario: autoload *.yaml files in _data directory

  1. Given I have a _data directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a "_data/products.yaml" file with content:
    features/step_definitions/jekyll_steps.rb:76
    - name: sugar
      price: 5.3
    - name: salt
      price: 2.5
  3. And I have an "index.html" page that contains "{% for product in site.data.products %}{{product.name}}{% endfor %}"
    features/step_definitions/jekyll_steps.rb:43
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the "_site/index.html" file should exist
    features/step_definitions/jekyll_steps.rb:203
  6. And I should see "sugar" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  7. And I should see "salt" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/data.feature:21

Scenario: autoload *.yml files in _data directory

  1. Given I have a _data directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a "_data/members.yml" file with content:
    features/step_definitions/jekyll_steps.rb:76
    - name: Jack
      age: 28
    - name: Leon
      age: 34
  3. And I have an "index.html" page that contains "{% for member in site.data.members %}{{member.name}}{% endfor %}"
    features/step_definitions/jekyll_steps.rb:43
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the "_site/index.html" file should exist
    features/step_definitions/jekyll_steps.rb:203
  6. And I should see "Jack" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  7. And I should see "Leon" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/data.feature:36

Scenario: autoload *.json files in _data directory

  1. Given I have a _data directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a "_data/members.json" file with content:
    features/step_definitions/jekyll_steps.rb:76
    [{"name": "Jack", "age": 28},{"name": "Leon", "age": 34}]
  3. And I have an "index.html" page that contains "{% for member in site.data.members %}{{member.name}}{% endfor %}"
    features/step_definitions/jekyll_steps.rb:43
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the "_site/index.html" file should exist
    features/step_definitions/jekyll_steps.rb:203
  6. And I should see "Jack" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  7. And I should see "Leon" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/data.feature:48

Scenario: autoload *.csv files in _data directory

  1. Given I have a _data directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a "_data/members.csv" file with content:
    features/step_definitions/jekyll_steps.rb:76
    name,age
    Jack,28
    Leon,34
  3. And I have an "index.html" page that contains "{% for member in site.data.members %}{{member.name}}{% endfor %}"
    features/step_definitions/jekyll_steps.rb:43
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the "_site/index.html" file should exist
    features/step_definitions/jekyll_steps.rb:203
  6. And I should see "Jack" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  7. And I should see "Leon" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/data.feature:62

Scenario: autoload *.yml files in _data directory with space in file name

  1. Given I have a _data directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a "_data/team members.yml" file with content:
    features/step_definitions/jekyll_steps.rb:76
    - name: Jack
      age: 28
    - name: Leon
      age: 34
  3. And I have an "index.html" page that contains "{% for member in site.data.team_members %}{{member.name}}{% endfor %}"
    features/step_definitions/jekyll_steps.rb:43
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the "_site/index.html" file should exist
    features/step_definitions/jekyll_steps.rb:203
  6. And I should see "Jack" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  7. And I should see "Leon" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/data.feature:77

Scenario: autoload *.yaml files in subdirectories in _data directory

  1. Given I have a _data directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a _data/categories directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have a "_data/categories/dairy.yaml" file with content:
    features/step_definitions/jekyll_steps.rb:76
    name: Dairy Products
  4. And I have an "index.html" page that contains "{{ site.data.categories.dairy.name }}"
    features/step_definitions/jekyll_steps.rb:43
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the "_site/index.html" file should exist
    features/step_definitions/jekyll_steps.rb:203
  7. And I should see "Dairy Products" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/data.feature:89

Scenario: folders should have precedence over files with the same name

  1. Given I have a _data directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a _data/categories directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have a "_data/categories/dairy.yaml" file with content:
    features/step_definitions/jekyll_steps.rb:76
    name: Dairy Products
  4. And I have a "_data/categories.yaml" file with content:
    features/step_definitions/jekyll_steps.rb:76
    dairy:
      name: Should not display this
  5. And I have an "index.html" page that contains "{{ site.data.categories.dairy.name }}"
    features/step_definitions/jekyll_steps.rb:43
  6. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  7. Then the "_site/index.html" file should exist
    features/step_definitions/jekyll_steps.rb:203
  8. And I should see "Dairy Products" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/data.feature:106

Scenario: should be backward compatible with site.data in _config.yml

  1. Given I have a "_config.yml" file with content:
    features/step_definitions/jekyll_steps.rb:76
    data:
      - name: Jack
        age: 28
      - name: Leon
        age: 34
  2. And I have an "index.html" page that contains "{% for member in site.data %}{{member.name}}{% endfor %}"
    features/step_definitions/jekyll_steps.rb:43
  3. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  4. Then the "_site/index.html" file should exist
    features/step_definitions/jekyll_steps.rb:203
  5. And I should see "Jack" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  6. And I should see "Leon" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187

Feature: Draft Posts

As a hacker who likes to blog
I want to be able to preview drafts locally
In order to see if they look alright before publishing

features/drafts.feature:6

Scenario: Preview a draft

  1. Given I have a configuration file with "permalink" set to "none"
    features/step_definitions/jekyll_steps.rb:112
  2. And I have a _drafts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have the following draft:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    Recipe
    2009-03-27
    default
    Not baked yet.
  4. When I run jekyll build --drafts
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "Not baked yet." in "_site/recipe.html"
    features/step_definitions/jekyll_steps.rb:187
features/drafts.feature:16

Scenario: Don't preview a draft

  1. Given I have a configuration file with "permalink" set to "none"
    features/step_definitions/jekyll_steps.rb:112
  2. And I have an "index.html" page that contains "Totally index"
    features/step_definitions/jekyll_steps.rb:43
  3. And I have a _drafts directory
    features/step_definitions/jekyll_steps.rb:82
  4. And I have the following draft:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    Recipe
    2009-03-27
    default
    Not baked yet.
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And the "_site/recipe.html" file should not exist
    features/step_definitions/jekyll_steps.rb:215
features/drafts.feature:27

Scenario: Don't preview a draft that is not published

  1. Given I have a configuration file with "permalink" set to "none"
    features/step_definitions/jekyll_steps.rb:112
  2. And I have an "index.html" page that contains "Totally index"
    features/step_definitions/jekyll_steps.rb:43
  3. And I have a _drafts directory
    features/step_definitions/jekyll_steps.rb:82
  4. And I have the following draft:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    published
    content
    Recipe
    2009-03-27
    default
    false
    Not baked yet.
  5. When I run jekyll build --drafts
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And the "_site/recipe.html" file should not exist
    features/step_definitions/jekyll_steps.rb:215
features/drafts.feature:38

Scenario: Use page.path variable

  1. Given I have a configuration file with "permalink" set to "none"
    features/step_definitions/jekyll_steps.rb:112
  2. And I have a _drafts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have the following draft:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    Recipe
    2009-03-27
    simple
    Post path: {{ page.path }}
  4. When I run jekyll build --drafts
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "Post path: _drafts/recipe.markdown" in "_site/recipe.html"
    features/step_definitions/jekyll_steps.rb:187

Feature: Embed filters

As a hacker who likes to blog
I want to be able to transform text inside a post or page
In order to perform cool stuff in my posts

features/embed_filters.feature:6

Scenario: Convert date to XML schema

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    Star Wars
    2009-03-27
    default
    These aren't the droids you're looking for.
  4. And I have a default layout that contains "{{ site.time | date_to_xmlschema }}"
    features/step_definitions/jekyll_steps.rb:60
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see today's date in "_site/2009/03/27/star-wars.html"
    features/step_definitions/jekyll_steps.rb:223
features/embed_filters.feature:17

Scenario: Escape text for XML

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    Star & Wars
    2009-03-27
    default
    These aren't the droids you're looking for.
  4. And I have a default layout that contains "{{ page.title | xml_escape }}"
    features/step_definitions/jekyll_steps.rb:60
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "Star &amp; Wars" in "_site/2009/03/27/star-wars.html"
    features/step_definitions/jekyll_steps.rb:187
features/embed_filters.feature:28

Scenario: Calculate number of words

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    Star Wars
    2009-03-27
    default
    These aren't the droids you're looking for.
  4. And I have a default layout that contains "{{ content | number_of_words }}"
    features/step_definitions/jekyll_steps.rb:60
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "7" in "_site/2009/03/27/star-wars.html"
    features/step_definitions/jekyll_steps.rb:187
features/embed_filters.feature:39

Scenario: Convert an array into a sentence

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    tags
    content
    Star Wars
    2009-03-27
    default
    [scifi, movies, force]
    These aren't the droids you're looking for.
  4. And I have a default layout that contains "{{ page.tags | array_to_sentence_string }}"
    features/step_definitions/jekyll_steps.rb:60
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "scifi, movies, and force" in "_site/2009/03/27/star-wars.html"
    features/step_definitions/jekyll_steps.rb:187
features/embed_filters.feature:50

Scenario: Markdownify a given string

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    Star Wars
    2009-03-27
    default
    These aren't the droids you're looking for.
  4. And I have a default layout that contains "By {{ '_Obi-wan_' | markdownify }}"
    features/step_definitions/jekyll_steps.rb:60
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "By <p><em>Obi-wan</em></p>" in "_site/2009/03/27/star-wars.html"
    features/step_definitions/jekyll_steps.rb:187
features/embed_filters.feature:61

Scenario: Sort by an arbitrary variable

  1. Given I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have the following page:
    features/step_definitions/jekyll_steps.rb:86
    title
    layout
    value
    content
    Page-1
    default
    8
    Something
  3. And I have the following page:
    features/step_definitions/jekyll_steps.rb:86
    title
    layout
    value
    content
    Page-2
    default
    6
    Something
  4. And I have a default layout that contains "{{ site.pages | sort:'value' | map:'title' | join:', ' }}"
    features/step_definitions/jekyll_steps.rb:60
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see exactly "Page-2, Page-1" in "_site/page-1.html"
    features/step_definitions/jekyll_steps.rb:191
  8. And I should see exactly "Page-2, Page-1" in "_site/page-2.html"
    features/step_definitions/jekyll_steps.rb:191
features/embed_filters.feature:75

Scenario: Sort pages by the title

  1. Given I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have the following page:
    features/step_definitions/jekyll_steps.rb:86
    title
    layout
    content
    Dog
    default
    Run
  3. And I have the following page:
    features/step_definitions/jekyll_steps.rb:86
    title
    layout
    content
    Bird
    default
    Fly
  4. And I have the following page:
    features/step_definitions/jekyll_steps.rb:86
    layout
    content
    default
    Jump
  5. And I have a default layout that contains "{% assign sorted_pages = site.pages | sort: 'title' %}The rule of {{ sorted_pages.size }}: {% for p in sorted_pages %}{{ p.content | strip_html | strip_newlines }}, {% endfor %}"
    features/step_definitions/jekyll_steps.rb:60
  6. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  7. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  8. And I should see exactly "The rule of 3: Jump, Fly, Run," in "_site/bird.html"
    features/step_definitions/jekyll_steps.rb:191
features/embed_filters.feature:91

Scenario: Sort pages by the title ordering pages without title last

  1. Given I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have the following page:
    features/step_definitions/jekyll_steps.rb:86
    title
    layout
    content
    Dog
    default
    Run
  3. And I have the following page:
    features/step_definitions/jekyll_steps.rb:86
    title
    layout
    content
    Bird
    default
    Fly
  4. And I have the following page:
    features/step_definitions/jekyll_steps.rb:86
    layout
    content
    default
    Jump
  5. And I have a default layout that contains "{% assign sorted_pages = site.pages | sort: 'title', 'last' %}The rule of {{ sorted_pages.size }}: {% for p in sorted_pages %}{{ p.content | strip_html | strip_newlines }}, {% endfor %}"
    features/step_definitions/jekyll_steps.rb:60
  6. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  7. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  8. And I should see exactly "The rule of 3: Fly, Run, Jump," in "_site/bird.html"
    features/step_definitions/jekyll_steps.rb:191

Feature: frontmatter defaults

features/frontmatter_defaults.feature:2

Scenario: Use default for frontmatter variables internally

  1. Given I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a pretty layout that contains "THIS IS THE LAYOUT: {{content}}"
    features/step_definitions/jekyll_steps.rb:60
  3. And I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  4. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    content
    default layout
    2013-09-11
    just some post
  5. And I have an "index.html" page with title "some title" that contains "just some page"
    features/step_definitions/jekyll_steps.rb:43
  6. And I have a configuration file with "defaults" set to "[{scope: {path: ""}, values: {layout: "pretty"}}]"
    features/step_definitions/jekyll_steps.rb:112
  7. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  8. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  9. And I should see "THIS IS THE LAYOUT: <p>just some post</p>" in "_site/2013/09/11/default-layout.html"
    features/step_definitions/jekyll_steps.rb:187
  10. And I should see "THIS IS THE LAYOUT: just some page" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/frontmatter_defaults.feature:19

Scenario: Use default for frontmatter variables in Liquid

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    content
    default data
    2013-09-11
    <p>{{page.custom}}</p><div>{{page.author}}</div>
  3. And I have an "index.html" page that contains "just {{page.custom}} by {{page.author}}"
    features/step_definitions/jekyll_steps.rb:43
  4. And I have a configuration file with "defaults" set to "[{scope: {path: ""}, values: {custom: "some special data", author: "Ben"}}]"
    features/step_definitions/jekyll_steps.rb:112
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "<p>some special data</p>\n<div>Ben</div>" in "_site/2013/09/11/default-data.html"
    features/step_definitions/jekyll_steps.rb:187
  8. And I should see "just some special data by Ben" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/frontmatter_defaults.feature:31

Scenario: Override frontmatter defaults by path

  1. Given I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a root layout that contains "root: {{ content }}"
    features/step_definitions/jekyll_steps.rb:60
  3. And I have a subfolder layout that contains "subfolder: {{ content }}"
    features/step_definitions/jekyll_steps.rb:60
  4. And I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  5. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    content
    about
    2013-10-14
    info on {{page.description}}
  6. And I have a special/_posts directory
    features/step_definitions/jekyll_steps.rb:82
  7. And I have the following post in "special":
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    path
    content
    about
    2013-10-14
    local
    info on {{page.description}}
  8. And I have an "index.html" page with title "overview" that contains "Overview for {{page.description}}"
    features/step_definitions/jekyll_steps.rb:43
  9. And I have an "special/index.html" page with title "section overview" that contains "Overview for {{page.description}}"
    features/step_definitions/jekyll_steps.rb:43
  10. And I have a configuration file with "defaults" set to "[{scope: {path: "special"}, values: {layout: "subfolder", description: "the special section"}}, {scope: {path: ""}, values: {layout: "root", description: "the webpage"}}]"
    features/step_definitions/jekyll_steps.rb:112
  11. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  12. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  13. And I should see "root: <p>info on the webpage</p>" in "_site/2013/10/14/about.html"
    features/step_definitions/jekyll_steps.rb:187
  14. And I should see "subfolder: <p>info on the special section</p>" in "_site/special/2013/10/14/about.html"
    features/step_definitions/jekyll_steps.rb:187
  15. And I should see "root: Overview for the webpage" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  16. And I should see "subfolder: Overview for the special section" in "_site/special/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/frontmatter_defaults.feature:57

Scenario: Use frontmatter variables by relative path

  1. Given I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a main layout that contains "main: {{ content }}"
    features/step_definitions/jekyll_steps.rb:60
  3. And I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  4. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    content
    about
    2013-10-14
    content of site/2013/10/14/about.html
  5. And I have a special/_posts directory
    features/step_definitions/jekyll_steps.rb:82
  6. And I have the following post in "special":
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    path
    content
    about1
    2013-10-14
    local
    content of site/special/2013/10/14/about1.html
    about2
    2013-10-14
    local
    content of site/special/2013/10/14/about2.html
  7. And I have a configuration file with "defaults" set to "[{scope: {path: "special"}, values: {layout: "main"}}, {scope: {path: "special/_posts"}, values: {layout: "main"}}, {scope: {path: "_posts"}, values: {layout: "main"}}]"
    features/step_definitions/jekyll_steps.rb:112
  8. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  9. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  10. And I should see "main: <p>content of site/2013/10/14/about.html</p>" in "_site/2013/10/14/about.html"
    features/step_definitions/jekyll_steps.rb:187
  11. And I should see "main: <p>content of site/special/2013/10/14/about1.html</p>" in "_site/special/2013/10/14/about1.html"
    features/step_definitions/jekyll_steps.rb:187
  12. And I should see "main: <p>content of site/special/2013/10/14/about2.html</p>" in "_site/special/2013/10/14/about2.html"
    features/step_definitions/jekyll_steps.rb:187
features/frontmatter_defaults.feature:79

Scenario: Override frontmatter defaults by type

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    content
    this is a post
    2013-10-14
    blabla
  3. And I have an "index.html" page that contains "interesting stuff"
    features/step_definitions/jekyll_steps.rb:43
  4. And I have a configuration file with "defaults" set to "[{scope: {path: "", type: "post"}, values: {permalink: "/post.html"}}, {scope: {path: "", type: "page"}, values: {permalink: "/page.html"}}, {scope: {path: ""}, values: {permalink: "/perma.html"}}]"
    features/step_definitions/jekyll_steps.rb:112
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then I should see "blabla" in "_site/post.html"
    features/step_definitions/jekyll_steps.rb:187
  7. And I should see "interesting stuff" in "_site/page.html"
    features/step_definitions/jekyll_steps.rb:187
  8. But the "_site/perma.html" file should not exist
    features/step_definitions/jekyll_steps.rb:215
features/frontmatter_defaults.feature:91

Scenario: Actual frontmatter overrides defaults

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    permalink
    author
    content
    override
    2013-10-14
    /frontmatter.html
    some guy
    a blog by {{page.author}}
  3. And I have an "index.html" page with permalink "override.html" that contains "nothing"
    features/step_definitions/jekyll_steps.rb:43
  4. And I have a configuration file with "defaults" set to "[{scope: {path: ""}, values: {permalink: "/perma.html", author: "Chris"}}]"
    features/step_definitions/jekyll_steps.rb:112
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then I should see "a blog by some guy" in "_site/frontmatter.html"
    features/step_definitions/jekyll_steps.rb:187
  7. And I should see "nothing" in "_site/override.html"
    features/step_definitions/jekyll_steps.rb:187
  8. But the "_site/perma.html" file should not exist
    features/step_definitions/jekyll_steps.rb:215
features/frontmatter_defaults.feature:103

Scenario: Define permalink default for posts

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    category
    content
    testpost
    2013-10-14
    blog
    blabla
  3. And I have a configuration file with "defaults" set to "[{scope: {path: "", type: "posts"}, values: {permalink: "/:categories/:title/"}}]"
    features/step_definitions/jekyll_steps.rb:112
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then I should see "blabla" in "_site/blog/testpost/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/frontmatter_defaults.feature:112

Scenario: Use frontmatter defaults in collections

  1. Given I have a _slides directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a "index.html" file that contains "nothing"
    features/step_definitions/jekyll_steps.rb:54
  3. And I have a "_slides/slide1.html" file with content:
    features/step_definitions/jekyll_steps.rb:76
    ---
    ---
    Value: {{ page.myval }}
  4. And I have a "_config.yml" file with content:
    features/step_definitions/jekyll_steps.rb:76
      collections:
        slides:
          output: true
      defaults:
        -
          scope:
            path: ""
            type: slides
          values:
            myval: "Test"
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "Value: Test" in "_site/slides/slide1.html"
    features/step_definitions/jekyll_steps.rb:187
features/frontmatter_defaults.feature:138

Scenario: Override frontmatter defaults inside a collection

  1. Given I have a _slides directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a "index.html" file that contains "nothing"
    features/step_definitions/jekyll_steps.rb:54
  3. And I have a "_slides/slide2.html" file with content:
    features/step_definitions/jekyll_steps.rb:76
    ---
    myval: Override
    ---
    Value: {{ page.myval }}
  4. And I have a "_config.yml" file with content:
    features/step_definitions/jekyll_steps.rb:76
      collections:
        slides:
          output: true
      defaults:
        -
          scope:
            path: ""
            type: slides
          values:
            myval: "Test"
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "Value: Override" in "_site/slides/slide2.html"
    features/step_definitions/jekyll_steps.rb:187
features/frontmatter_defaults.feature:165

Scenario: Deep merge frontmatter defaults

  1. Given I have an "index.html" page with fruit "{orange: 1}" that contains "Fruits: {{ page.fruit.orange | plus: page.fruit.apple }}"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have a configuration file with "defaults" set to "[{scope: {path: ""}, values: {fruit: {apple: 2}}}]"
    features/step_definitions/jekyll_steps.rb:112
  3. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  4. Then I should see "Fruits: 3" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187

Feature: Hooks

As a plugin author
I want to be able to run code during various stages of the build process

features/hooks.feature:5

Scenario: Run some code after site reset

  1. Given I have a _plugins directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a "_plugins/ext.rb" file with content:
    features/step_definitions/jekyll_steps.rb:76
    Jekyll::Hooks.register :site, :after_reset do |site|
      pageklass = Class.new(Jekyll::Page) do
        def initialize(site, base)
          @site = site
          @base = base
          @data = {}
          @dir = '/'
          @name = 'foo.html'
          @content = 'mytinypage'
    
          self.process(@name)
        end
      end
    
      site.pages << pageklass.new(site, site.source)
    end
  3. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  4. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  5. And I should see "mytinypage" in "_site/foo.html"
    features/step_definitions/jekyll_steps.rb:187
features/hooks.feature:30

Scenario: Modify the payload before rendering the site

  1. Given I have a _plugins directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a "index.html" page that contains "{{ site.injected }}!"
    features/step_definitions/jekyll_steps.rb:43
  3. And I have a "_plugins/ext.rb" file with content:
    features/step_definitions/jekyll_steps.rb:76
    Jekyll::Hooks.register :site, :pre_render do |site, payload|
      payload['site']['injected'] = 'myparam'
    end
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "myparam!" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/hooks.feature:43

Scenario: Modify the site contents after reading

  1. Given I have a _plugins directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a "page1.html" page that contains "page1"
    features/step_definitions/jekyll_steps.rb:43
  3. And I have a "page2.html" page that contains "page2"
    features/step_definitions/jekyll_steps.rb:43
  4. And I have a "_plugins/ext.rb" file with content:
    features/step_definitions/jekyll_steps.rb:76
    Jekyll::Hooks.register :site, :post_read do |site|
      site.pages.delete_if { |p| p.name == 'page1.html' }
    end
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And the "_site/page1.html" file should not exist
    features/step_definitions/jekyll_steps.rb:215
  8. And I should see "page2" in "_site/page2.html"
    features/step_definitions/jekyll_steps.rb:187
features/hooks.feature:58

Scenario: Work with the site files after they've been written to disk

  1. Given I have a _plugins directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a "_plugins/ext.rb" file with content:
    features/step_definitions/jekyll_steps.rb:76
    Jekyll::Hooks.register :site, :post_write do |site|
      firstpage = site.pages.first
      content = File.read firstpage.destination(site.dest)
      File.write(File.join(site.dest, 'firstpage.html'), content)
    end
  3. And I have a "page1.html" page that contains "page1"
    features/step_definitions/jekyll_steps.rb:43
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "page1" in "_site/firstpage.html"
    features/step_definitions/jekyll_steps.rb:187
features/hooks.feature:73

Scenario: Alter a page right after it is initialized

  1. Given I have a _plugins directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a "_plugins/ext.rb" file with content:
    features/step_definitions/jekyll_steps.rb:76
    Jekyll::Hooks.register :page, :post_init do |page|
      page.name = 'renamed.html'
      page.process(page.name)
    end
  3. And I have a "page1.html" page that contains "page1"
    features/step_definitions/jekyll_steps.rb:43
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "page1" in "_site/renamed.html"
    features/step_definitions/jekyll_steps.rb:187
features/hooks.feature:87

Scenario: Alter the payload for one page but not another

  1. Given I have a _plugins directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a "_plugins/ext.rb" file with content:
    features/step_definitions/jekyll_steps.rb:76
    Jekyll::Hooks.register :page, :pre_render do |page, payload|
      payload['myparam'] = 'special' if page.name == 'page1.html'
    end
  3. And I have a "page1.html" page that contains "{{ myparam }}"
    features/step_definitions/jekyll_steps.rb:43
  4. And I have a "page2.html" page that contains "{{ myparam }}"
    features/step_definitions/jekyll_steps.rb:43
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then I should see "special" in "_site/page1.html"
    features/step_definitions/jekyll_steps.rb:187
  7. And I should not see "special" in "_site/page2.html"
    features/step_definitions/jekyll_steps.rb:195
features/hooks.feature:101

Scenario: Modify page contents before writing to disk

  1. Given I have a _plugins directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a "index.html" page that contains "WRAP ME"
    features/step_definitions/jekyll_steps.rb:43
  3. And I have a "_plugins/ext.rb" file with content:
    features/step_definitions/jekyll_steps.rb:76
    Jekyll::Hooks.register :page, :post_render do |page|
      page.output = "{{{{{ #{page.output.chomp} }}}}}"
    end
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then I should see "{{{{{ WRAP ME }}}}}" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/hooks.feature:113

Scenario: Work with a page after writing it to disk

  1. Given I have a _plugins directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a "index.html" page that contains "HELLO FROM A PAGE"
    features/step_definitions/jekyll_steps.rb:43
  3. And I have a "_plugins/ext.rb" file with content:
    features/step_definitions/jekyll_steps.rb:76
    Jekyll::Hooks.register :page, :post_write do |page|
      require 'fileutils'
      filename = page.destination(page.site.dest)
      FileUtils.mv(filename, "#{filename}.moved")
    end
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then I should see "HELLO FROM A PAGE" in "_site/index.html.moved"
    features/step_definitions/jekyll_steps.rb:187
features/hooks.feature:127

Scenario: Alter a post right after it is initialized

  1. Given I have a _plugins directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a "_plugins/ext.rb" file with content:
    features/step_definitions/jekyll_steps.rb:76
    # rot13 translate
    Jekyll::Hooks.register :post, :post_init do |post|
      post.content.tr!('abcdefghijklmnopqrstuvwxyz',
        'nopqrstuvwxyzabcdefghijklm')
    end
  3. And I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  4. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    entry1
    2015-03-14
    nil
    content for entry1.
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "pbagrag sbe ragel1." in "_site/2015/03/14/entry1.html"
    features/step_definitions/jekyll_steps.rb:187
features/hooks.feature:145

Scenario: Alter the payload for certain posts

  1. Given I have a _plugins directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a "_plugins/ext.rb" file with content:
    features/step_definitions/jekyll_steps.rb:76
    # Add myvar = 'old' to posts before 2015-03-15, and myvar = 'new' for
    # others
    Jekyll::Hooks.register :post, :pre_render do |post, payload|
      if post.date < Time.new(2015, 3, 15)
        payload['myvar'] = 'old'
      else
        payload['myvar'] = 'new'
      end
    end
  3. And I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  4. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    entry1
    2015-03-14
    nil
    {{ myvar }} post
    entry2
    2015-03-15
    nil
    {{ myvar }} post
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then I should see "old post" in "_site/2015/03/14/entry1.html"
    features/step_definitions/jekyll_steps.rb:187
  7. And I should see "new post" in "_site/2015/03/15/entry2.html"
    features/step_definitions/jekyll_steps.rb:187
features/hooks.feature:168

Scenario: Modify post contents before writing to disk

  1. Given I have a _plugins directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a "_plugins/ext.rb" file with content:
    features/step_definitions/jekyll_steps.rb:76
    # Replace content after rendering
    Jekyll::Hooks.register :post, :post_render do |post|
      post.output.gsub! /42/, 'the answer to life, the universe and everything'
    end
  3. And I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  4. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    entry1
    2015-03-14
    nil
    {{ 6 | times: 7 }}
    entry2
    2015-03-15
    nil
    {{ 6 | times: 8 }}
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then I should see "the answer to life, the universe and everything" in "_site/2015/03/14/entry1.html"
    features/step_definitions/jekyll_steps.rb:187
  7. And I should see "48" in "_site/2015/03/15/entry2.html"
    features/step_definitions/jekyll_steps.rb:187
features/hooks.feature:186

Scenario: Work with a post after writing it to disk

  1. Given I have a _plugins directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a "_plugins/ext.rb" file with content:
    features/step_definitions/jekyll_steps.rb:76
    # Log all post filesystem writes
    Jekyll::Hooks.register :post, :post_write do |post|
      filename = post.destination(post.site.dest)
      open('_site/post-build.log', 'a') do |f|
        f.puts "Wrote #{filename} at #{Time.now}"
      end
    end
  3. And I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  4. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    entry1
    2015-03-14
    nil
    entry one
    entry2
    2015-03-15
    nil
    entry two
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then I should see "_site/2015/03/14/entry1.html at" in "_site/post-build.log"
    features/step_definitions/jekyll_steps.rb:187
  7. Then I should see "_site/2015/03/15/entry2.html at" in "_site/post-build.log"
    features/step_definitions/jekyll_steps.rb:187
features/hooks.feature:207

Scenario: Register a hook on multiple owners at the same time

  1. Given I have a _plugins directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a "_plugins/ext.rb" file with content:
    features/step_definitions/jekyll_steps.rb:76
    Jekyll::Hooks.register [:page, :post], :post_render do |owner|
      owner.output = "{{{{{ #{owner.output.chomp} }}}}}"
    end
  3. And I have a "index.html" page that contains "WRAP ME"
    features/step_definitions/jekyll_steps.rb:43
  4. And I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  5. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    entry1
    2015-03-14
    nil
    entry one
  6. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  7. Then I should see "{{{{{ WRAP ME }}}}}" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  8. And I should see "{{{{{ <p>entry one</p> }}}}}" in "_site/2015/03/14/entry1.html"
    features/step_definitions/jekyll_steps.rb:187
features/hooks.feature:224

Scenario: Allow hooks to have a named priority

  1. Given I have a _plugins directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a "_plugins/ext.rb" file with content:
    features/step_definitions/jekyll_steps.rb:76
    Jekyll::Hooks.register :page, :post_render, priority: :normal do |owner|
      # first normal runs second
      owner.output = "1 #{owner.output.chomp}"
    end
    Jekyll::Hooks.register :page, :post_render, priority: :high do |owner|
      # high runs last
      owner.output = "2 #{owner.output.chomp}"
    end
    Jekyll::Hooks.register :page, :post_render do |owner|
      # second normal runs third (normal is default)
      owner.output = "3 #{owner.output.chomp}"
    end
    Jekyll::Hooks.register :page, :post_render, priority: :low do |owner|
      # low runs first
      owner.output = "4 #{owner.output.chomp}"
    end
  3. And I have a "index.html" page that contains "WRAP ME"
    features/step_definitions/jekyll_steps.rb:43
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then I should see "2 3 1 4 WRAP ME" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/hooks.feature:249

Scenario: Alter a document right after it is initialized

  1. Given I have a _plugins directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a "_plugins/ext.rb" file with content:
    features/step_definitions/jekyll_steps.rb:76
    Jekyll::Hooks.register :document, :pre_render do |doc, payload|
      doc.data['text'] = doc.data['text'] << ' are belong to us'
    end
  3. And I have a "_config.yml" file that contains "collections: [ memes ]"
    features/step_definitions/jekyll_steps.rb:54
  4. And I have a _memes directory
    features/step_definitions/jekyll_steps.rb:82
  5. And I have a "_memes/doc1.md" file with content:
    features/step_definitions/jekyll_steps.rb:76
    ---
    text: all your base
    ---
  6. And I have an "index.md" file with content:
    features/step_definitions/jekyll_steps.rb:76
    ---
    ---
    {{ site.memes.first.text }}
  7. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  8. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  9. And I should see "all your base are belong to us" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/hooks.feature:275

Scenario: Update a document after rendering it, but before writing it to disk

  1. Given I have a _plugins directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a "_plugins/ext.rb" file with content:
    features/step_definitions/jekyll_steps.rb:76
    Jekyll::Hooks.register :document, :post_render do |doc|
      doc.output.gsub! /<p>/, '<p class="meme">'
    end
  3. And I have a "_config.yml" file with content:
    features/step_definitions/jekyll_steps.rb:76
    collections:
      memes:
        output: true
  4. And I have a _memes directory
    features/step_definitions/jekyll_steps.rb:82
  5. And I have a "_memes/doc1.md" file with content:
    features/step_definitions/jekyll_steps.rb:76
    ---
    text: all your base are belong to us
    ---
    {{ page.text }}
  6. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  7. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  8. And I should see "<p class=\"meme\">all your base are belong to us" in "_site/memes/doc1.html"
    features/step_definitions/jekyll_steps.rb:187
features/hooks.feature:301

Scenario: Perform an action after every document is written

  1. Given I have a _plugins directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a "_plugins/ext.rb" file with content:
    features/step_definitions/jekyll_steps.rb:76
    Jekyll::Hooks.register :document, :post_write do |doc|
      open('_site/document-build.log', 'a') do |f|
        f.puts "Wrote document #{doc.collection.docs.index doc} at #{Time.now}"
      end
    end
  3. And I have a "_config.yml" file with content:
    features/step_definitions/jekyll_steps.rb:76
    collections:
      memes:
        output: true
  4. And I have a _memes directory
    features/step_definitions/jekyll_steps.rb:82
  5. And I have a "_memes/doc1.md" file with content:
    features/step_definitions/jekyll_steps.rb:76
    ---
    text: all your base are belong to us
    ---
    {{ page.text }}
  6. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  7. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  8. And I should see "Wrote document 0" in "_site/document-build.log"
    features/step_definitions/jekyll_steps.rb:187

Feature: Include tags

In order to share their content across several pages
As a hacker who likes to blog
I want to be able to include files in my blog posts

features/include_tag.feature:6

Scenario: Include a file with parameters

  1. Given I have an _includes directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have an "_includes/header.html" file that contains "<header>My awesome blog header: {{include.param}}</header>"
    features/step_definitions/jekyll_steps.rb:54
  3. And I have an "_includes/params.html" file that contains "Parameters:<ul>{% for param in include %}<li>{{param[0]}} = {{param[1]}}</li>{% endfor %}</ul>"
    features/step_definitions/jekyll_steps.rb:54
  4. And I have an "_includes/ignore.html" file that contains "<footer>My blog footer</footer>"
    features/step_definitions/jekyll_steps.rb:54
  5. And I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  6. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    type
    content
    Include Files
    2013-03-21
    html
    {% include header.html param="myparam" %}
    Ignore params if unused
    2013-03-21
    html
    {% include ignore.html date="today" %}
    List multiple parameters
    2013-03-21
    html
    {% include params.html date="today" start="tomorrow" %}
    Dont keep parameters
    2013-03-21
    html
    {% include ignore.html param="test" %} {% include header.html %}
    Allow params with spaces and quotes
    2013-04-07
    html
    {% include params.html cool="param with spaces" super="\"quoted\"" single='has "quotes"' escaped='\'single\' quotes' %}
    Parameter syntax
    2013-04-12
    html
    {% include params.html param1_or_2="value" %}
    Pass a variable
    2013-06-22
    html
    {% assign var = 'some text' %}{% include params.html local=var title=page.title %}
  7. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  8. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  9. And I should see "<header>My awesome blog header: myparam</header>" in "_site/2013/03/21/include-files.html"
    features/step_definitions/jekyll_steps.rb:187
  10. And I should not see "myparam" in "_site/2013/03/21/ignore-params-if-unused.html"
    features/step_definitions/jekyll_steps.rb:195
  11. And I should see "<li>date = today</li>" in "_site/2013/03/21/list-multiple-parameters.html"
    features/step_definitions/jekyll_steps.rb:187
  12. And I should see "<li>start = tomorrow</li>" in "_site/2013/03/21/list-multiple-parameters.html"
    features/step_definitions/jekyll_steps.rb:187
  13. And I should not see "<header>My awesome blog header: myparam</header>" in "_site/2013/03/21/dont-keep-parameters.html"
    features/step_definitions/jekyll_steps.rb:195
  14. But I should see "<header>My awesome blog header: </header>" in "_site/2013/03/21/dont-keep-parameters.html"
    features/step_definitions/jekyll_steps.rb:187
  15. And I should see "<li>cool = param with spaces</li>" in "_site/2013/04/07/allow-params-with-spaces-and-quotes.html"
    features/step_definitions/jekyll_steps.rb:187
  16. And I should see "<li>super = \"quoted\"</li>" in "_site/2013/04/07/allow-params-with-spaces-and-quotes.html"
    features/step_definitions/jekyll_steps.rb:187
  17. And I should see "<li>single = has \"quotes\"</li>" in "_site/2013/04/07/allow-params-with-spaces-and-quotes.html"
    features/step_definitions/jekyll_steps.rb:187
  18. And I should see "<li>escaped = 'single' quotes</li>" in "_site/2013/04/07/allow-params-with-spaces-and-quotes.html"
    features/step_definitions/jekyll_steps.rb:187
  19. And I should see "<li>param1_or_2 = value</li>" in "_site/2013/04/12/parameter-syntax.html"
    features/step_definitions/jekyll_steps.rb:187
  20. And I should see "<li>local = some text</li>" in "_site/2013/06/22/pass-a-variable.html"
    features/step_definitions/jekyll_steps.rb:187
  21. And I should see "<li>title = Pass a variable</li>" in "_site/2013/06/22/pass-a-variable.html"
    features/step_definitions/jekyll_steps.rb:187
features/include_tag.feature:37

Scenario: Include a file from a variable

  1. Given I have an _includes directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have an "_includes/snippet.html" file that contains "a snippet"
    features/step_definitions/jekyll_steps.rb:54
  3. And I have an "_includes/parametrized.html" file that contains "works with {{include.what}}"
    features/step_definitions/jekyll_steps.rb:54
  4. And I have a configuration file with:
    features/step_definitions/jekyll_steps.rb:118
    key
    value
    include_file1
    snippet.html
    include_file2
    parametrized.html
  5. And I have an "index.html" page that contains "{% include {{site.include_file1}} %} that {% include {{site.include_file2}} what='parameters' %}"
    features/step_definitions/jekyll_steps.rb:43
  6. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  7. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  8. And I should see "a snippet that works with parameters" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/include_tag.feature:50

Scenario: Include a variable file in a loop

  1. Given I have an _includes directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have an "_includes/one.html" file that contains "one"
    features/step_definitions/jekyll_steps.rb:54
  3. And I have an "_includes/two.html" file that contains "two"
    features/step_definitions/jekyll_steps.rb:54
  4. And I have an "index.html" page with files "[one.html, two.html]" that contains "{% for file in page.files %}{% include {{file}} %} {% endfor %}"
    features/step_definitions/jekyll_steps.rb:43
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "one two" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/include_tag.feature:59

Scenario: Include a file with variables and filters

  1. Given I have an _includes directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have an "_includes/one.html" file that contains "one included"
    features/step_definitions/jekyll_steps.rb:54
  3. And I have a configuration file with:
    features/step_definitions/jekyll_steps.rb:118
    key
    value
    include_file
    one
  4. And I have an "index.html" page that contains "{% include {{ site.include_file | append: '.html' }} %}"
    features/step_definitions/jekyll_steps.rb:43
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "one included" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/include_tag.feature:70

Scenario: Include a file with partial variables

  1. Given I have an _includes directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have an "_includes/one.html" file that contains "one included"
    features/step_definitions/jekyll_steps.rb:54
  3. And I have a configuration file with:
    features/step_definitions/jekyll_steps.rb:118
    key
    value
    include_file
    one
  4. And I have an "index.html" page that contains "{% include {{ site.include_file }}.html %}"
    features/step_definitions/jekyll_steps.rb:43
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "one included" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187

Feature: Incremental rebuild

As an impatient hacker who likes to blog
I want to be able to make a static site
Without waiting too long for it to build

features/incremental_rebuild.feature:6

Scenario: Produce correct output site

  1. Given I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    Wargames
    2009-03-27
    default
    The only winning move is not to play.
  4. And I have a default layout that contains "Post Layout: {{ content }}"
    features/step_definitions/jekyll_steps.rb:60
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "Post Layout: <p>The only winning move is not to play.</p>" in "_site/2009/03/27/wargames.html"
    features/step_definitions/jekyll_steps.rb:187
  8. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  9. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  10. And I should see "Post Layout: <p>The only winning move is not to play.</p>" in "_site/2009/03/27/wargames.html"
    features/step_definitions/jekyll_steps.rb:187
features/incremental_rebuild.feature:20

Scenario: Generate a metadata file

  1. Given I have an "index.html" file that contains "Basic Site"
    features/step_definitions/jekyll_steps.rb:54
  2. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  3. Then the ".jekyll-metadata" file should exist
    features/step_definitions/jekyll_steps.rb:203
features/incremental_rebuild.feature:25

Scenario: Rebuild when content is changed

  1. Given I have an "index.html" file that contains "Basic Site"
    features/step_definitions/jekyll_steps.rb:54
  2. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  3. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  4. And I should see "Basic Site" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  5. When I wait 1 second
    features/step_definitions/jekyll_steps.rb:139
  6. Then I have an "index.html" file that contains "Bacon Site"
    features/step_definitions/jekyll_steps.rb:54
  7. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  8. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  9. And I should see "Bacon Site" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/incremental_rebuild.feature:36

Scenario: Rebuild when layout is changed

  1. Given I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have an "index.html" page with layout "default" that contains "Basic Site with Layout"
    features/step_definitions/jekyll_steps.rb:43
  3. And I have a default layout that contains "Page Layout: {{ content }}"
    features/step_definitions/jekyll_steps.rb:60
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "Page Layout: Basic Site with Layout" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  7. When I wait 1 second
    features/step_definitions/jekyll_steps.rb:139
  8. Then I have a default layout that contains "Page Layout Changed: {{ content }}"
    features/step_definitions/jekyll_steps.rb:60
  9. When I run jekyll build --full-rebuild
    features/step_definitions/jekyll_steps.rb:149
  10. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  11. And I should see "Page Layout Changed: Basic Site with Layout" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/incremental_rebuild.feature:49

Scenario: Rebuild when an include is changed

  1. Given I have a _includes directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have an "index.html" page that contains "Basic Site with include tag: {% include about.textile %}"
    features/step_definitions/jekyll_steps.rb:43
  3. And I have an "_includes/about.textile" file that contains "Generated by Jekyll"
    features/step_definitions/jekyll_steps.rb:54
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "Basic Site with include tag: Generated by Jekyll" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  7. When I wait 1 second
    features/step_definitions/jekyll_steps.rb:139
  8. Then I have an "_includes/about.textile" file that contains "Regenerated by Jekyll"
    features/step_definitions/jekyll_steps.rb:54
  9. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  10. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  11. And I should see "Basic Site with include tag: Regenerated by Jekyll" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187

Feature: Markdown

As a hacker who likes to blog
I want to be able to make a static site
In order to share my awesome ideas with the interwebs

features/markdown.feature:6

Scenario: Markdown in list on index

  1. Given I have a configuration file with "paginate" set to "5"
    features/step_definitions/jekyll_steps.rb:112
  2. And I have an "index.html" page that contains "Index - {% for post in site.posts %} {{ post.content }} {% endfor %}"
    features/step_definitions/jekyll_steps.rb:43
  3. And I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  4. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    content
    type
    Hackers
    2009-03-27
    # My Title
    markdown
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "Index" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  8. And I should see "<h1 id=\"my-title\">My Title</h1>" in "_site/2009/03/27/hackers.html"
    features/step_definitions/jekyll_steps.rb:187
  9. And I should see "<h1 id=\"my-title\">My Title</h1>" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/markdown.feature:19

Scenario: Markdown in pagination on index

  1. Given I have a configuration file with:
    features/step_definitions/jekyll_steps.rb:118
    key
    value
    paginate
    5
    gems
    [jekyll-paginate]
  2. And I have an "index.html" page that contains "Index - {% for post in paginator.posts %} {{ post.content }} {% endfor %}"
    features/step_definitions/jekyll_steps.rb:43
  3. And I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  4. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    content
    type
    Hackers
    2009-03-27
    # My Title
    markdown
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "Index" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  8. And I should see "<h1 id=\"my-title\">My Title</h1>" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187

Feature: Site pagination

In order to paginate my blog
As a blog's user
I want divide the posts in several pages

features/pagination.feature:6

Scenario Outline: Paginate with N posts per page

  1. Given I have a configuration file with:
    features/pagination.feature:7
    key
    value
    paginate
    <num>
    gems
    [jekyll-paginate]
  2. And I have a _layouts directory
    features/pagination.feature:11
  3. And I have an "index.html" page that contains "{{ paginator.posts.size }}"
    features/pagination.feature:12
  4. And I have a _posts directory
    features/pagination.feature:13
  5. And I have the following posts:
    features/pagination.feature:14
    title
    date
    layout
    content
    Wargames
    2009-03-27
    default
    The only winning move is not to play.
    Wargames2
    2009-04-27
    default
    The only winning move is not to play2.
    Wargames3
    2009-05-27
    default
    The only winning move is not to play3.
    Wargames4
    2009-06-27
    default
    The only winning move is not to play4.
  6. When I run jekyll build
    features/pagination.feature:20
  7. Then the _site/page<exist> directory should exist
    features/pagination.feature:21
  8. And the "_site/page<exist>/index.html" file should exist
    features/pagination.feature:22
  9. And I should see "<posts>" in "_site/page<exist>/index.html"
    features/pagination.feature:23
  10. And the "_site/page<not_exist>/index.html" file should not exist
    features/pagination.feature:24

Examples

num
exist
posts
not_exist
1
4
1
5
2
2
2
3
3
2
1
3
features/pagination.feature:32

Scenario Outline: Setting a custom pagination path

  1. Given I have a configuration file with:
    features/pagination.feature:33
    key
    value
    paginate
    1
    paginate_path
    /blog/page-:num
    permalink
    /blog/:year/:month/:day/:title
    gems
    [jekyll-paginate]
  2. And I have a blog directory
    features/pagination.feature:39
  3. And I have an "blog/index.html" page that contains "{{ paginator.posts.size }}"
    features/pagination.feature:40
  4. And I have a _posts directory
    features/pagination.feature:41
  5. And I have the following posts:
    features/pagination.feature:42
    title
    date
    layout
    content
    Wargames
    2009-03-27
    default
    The only winning move is not to play.
    Wargames2
    2009-04-27
    default
    The only winning move is not to play2.
    Wargames3
    2009-05-27
    default
    The only winning move is not to play3.
    Wargames4
    2009-06-27
    default
    The only winning move is not to play4.
  6. When I run jekyll build
    features/pagination.feature:48
  7. Then the _site/blog/page-<exist> directory should exist
    features/pagination.feature:49
  8. And the "_site/blog/page-<exist>/index.html" file should exist
    features/pagination.feature:50
  9. And I should see "<posts>" in "_site/blog/page-<exist>/index.html"
    features/pagination.feature:51
  10. And the "_site/blog/page-<not_exist>/index.html" file should not exist
    features/pagination.feature:52

Examples

exist
posts
not_exist
2
1
5
3
1
6
4
1
7
features/pagination.feature:60

Scenario Outline: Setting a custom pagination path without an index.html in it

  1. Given I have a configuration file with:
    features/pagination.feature:61
    key
    value
    paginate
    1
    paginate_path
    /blog/page/:num
    permalink
    /blog/:year/:month/:day/:title
    gems
    [jekyll-paginate]
  2. And I have a blog directory
    features/pagination.feature:67
  3. And I have an "blog/index.html" page that contains "{{ paginator.posts.size }}"
    features/pagination.feature:68
  4. And I have an "index.html" page that contains "Don't pick me!"
    features/pagination.feature:69
  5. And I have a _posts directory
    features/pagination.feature:70
  6. And I have the following posts:
    features/pagination.feature:71
    title
    date
    layout
    content
    Wargames
    2009-03-27
    default
    The only winning move is not to play.
    Wargames2
    2009-04-27
    default
    The only winning move is not to play2.
    Wargames3
    2009-05-27
    default
    The only winning move is not to play3.
    Wargames4
    2009-06-27
    default
    The only winning move is not to play4.
  7. When I run jekyll build
    features/pagination.feature:77
  8. Then the _site/blog/page/<exist> directory should exist
    features/pagination.feature:78
  9. And the "_site/blog/page/<exist>/index.html" file should exist
    features/pagination.feature:79
  10. And I should see "<posts>" in "_site/blog/page/<exist>/index.html"
    features/pagination.feature:80
  11. And the "_site/blog/page/<not_exist>/index.html" file should not exist
    features/pagination.feature:81

Examples

exist
posts
not_exist
2
1
5
3
1
6
4
1
7

Feature: Fancy permalinks

As a hacker who likes to blog
I want to be able to set permalinks
In order to make my blog URLs awesome

features/permalinks.feature:6

Scenario: Use none permalink schema

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    content
    None Permalink Schema
    2009-03-27
    Totally nothing.
  3. And I have a configuration file with "permalink" set to "none"
    features/step_definitions/jekyll_steps.rb:112
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "Totally nothing." in "_site/none-permalink-schema.html"
    features/step_definitions/jekyll_steps.rb:187
features/permalinks.feature:16

Scenario: Use pretty permalink schema

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    content
    Pretty Permalink Schema
    2009-03-27
    Totally wordpress.
  3. And I have a configuration file with "permalink" set to "pretty"
    features/step_definitions/jekyll_steps.rb:112
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "Totally wordpress." in "_site/2009/03/27/pretty-permalink-schema/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/permalinks.feature:26

Scenario: Use pretty permalink schema for pages

  1. Given I have an "index.html" page that contains "Totally index"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have an "awesome.html" page that contains "Totally awesome"
    features/step_definitions/jekyll_steps.rb:43
  3. And I have an "sitemap.xml" page that contains "Totally uhm, sitemap"
    features/step_definitions/jekyll_steps.rb:43
  4. And I have a configuration file with "permalink" set to "pretty"
    features/step_definitions/jekyll_steps.rb:112
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "Totally index" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  8. And I should see "Totally awesome" in "_site/awesome/index.html"
    features/step_definitions/jekyll_steps.rb:187
  9. And I should see "Totally uhm, sitemap" in "_site/sitemap.xml"
    features/step_definitions/jekyll_steps.rb:187
features/permalinks.feature:37

Scenario: Use custom permalink schema with prefix

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    category
    date
    content
    Custom Permalink Schema
    stuff
    2009-03-27
    Totally custom.
  3. And I have a configuration file with "permalink" set to "/blog/:year/:month/:day/:title/"
    features/step_definitions/jekyll_steps.rb:112
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "Totally custom." in "_site/blog/2009/03/27/custom-permalink-schema/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/permalinks.feature:47

Scenario: Use custom permalink schema with category

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    category
    date
    content
    Custom Permalink Schema
    stuff
    2009-03-27
    Totally custom.
  3. And I have a configuration file with "permalink" set to "/:categories/:title.html"
    features/step_definitions/jekyll_steps.rb:112
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "Totally custom." in "_site/stuff/custom-permalink-schema.html"
    features/step_definitions/jekyll_steps.rb:187
features/permalinks.feature:57

Scenario: Use custom permalink schema with squished date

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    category
    date
    content
    Custom Permalink Schema
    stuff
    2009-03-27
    Totally custom.
  3. And I have a configuration file with "permalink" set to "/:month-:day-:year/:title.html"
    features/step_definitions/jekyll_steps.rb:112
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "Totally custom." in "_site/03-27-2009/custom-permalink-schema.html"
    features/step_definitions/jekyll_steps.rb:187
features/permalinks.feature:67

Scenario: Use per-post permalink

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    permalink
    content
    Some post
    2013-04-14
    /custom/posts/1/
    bla bla
  3. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  4. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  5. And the _site/custom/posts/1 directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "bla bla" in "_site/custom/posts/1/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/permalinks.feature:77

Scenario: Use per-post ending in .html

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    permalink
    content
    Some post
    2013-04-14
    /custom/posts/some.html
    bla bla
  3. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  4. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  5. And the _site/custom/posts directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "bla bla" in "_site/custom/posts/some.html"
    features/step_definitions/jekyll_steps.rb:187

Feature: Configuring and using plugins

As a hacker
I want to specify my own plugins that can modify Jekyll's behaviour

features/plugins.feature:5

Scenario: Add a gem-based plugin

  1. Given I have an "index.html" file that contains "Whatever"
    features/step_definitions/jekyll_steps.rb:54
  2. And I have a configuration file with "gems" set to "[jekyll_test_plugin]"
    features/step_definitions/jekyll_steps.rb:112
  3. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  4. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  5. And I should see "Whatever" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  6. And I should see "this is a test" in "_site/test.txt"
    features/step_definitions/jekyll_steps.rb:187
features/plugins.feature:13

Scenario: Add an empty whitelist to restrict all gems

  1. Given I have an "index.html" file that contains "Whatever"
    features/step_definitions/jekyll_steps.rb:54
  2. And I have a configuration file with:
    features/step_definitions/jekyll_steps.rb:118
    key
    value
    gems
    [jekyll_test_plugin]
    whitelist
    []
  3. When I run jekyll build --safe
    features/step_definitions/jekyll_steps.rb:149
  4. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  5. And I should see "Whatever" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  6. And the "_site/test.txt" file should not exist
    features/step_definitions/jekyll_steps.rb:215
features/plugins.feature:24

Scenario: Add a whitelist to restrict some gems but allow others

  1. Given I have an "index.html" file that contains "Whatever"
    features/step_definitions/jekyll_steps.rb:54
  2. And I have a configuration file with:
    features/step_definitions/jekyll_steps.rb:118
    key
    value
    gems
    [jekyll_test_plugin, jekyll_test_plugin_malicious]
    whitelist
    [jekyll_test_plugin]
  3. When I run jekyll build --safe
    features/step_definitions/jekyll_steps.rb:149
  4. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  5. And I should see "Whatever" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  6. And the "_site/test.txt" file should exist
    features/step_definitions/jekyll_steps.rb:203
  7. And I should see "this is a test" in "_site/test.txt"
    features/step_definitions/jekyll_steps.rb:187

Feature: Post data

As a hacker who likes to blog
I want to be able to embed data into my posts
In order to make the posts slightly dynamic

features/post_data.feature:6

Scenario: Use post.title variable

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    Star Wars
    2009-03-27
    simple
    Luke, I am your father.
  4. And I have a simple layout that contains "Post title: {{ page.title }}"
    features/step_definitions/jekyll_steps.rb:60
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "Post title: Star Wars" in "_site/2009/03/27/star-wars.html"
    features/step_definitions/jekyll_steps.rb:187
features/post_data.feature:17

Scenario: Use post.url variable

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    Star Wars
    2009-03-27
    simple
    Luke, I am your father.
  4. And I have a simple layout that contains "Post url: {{ page.url }}"
    features/step_definitions/jekyll_steps.rb:60
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "Post url: /2009/03/27/star-wars.html" in "_site/2009/03/27/star-wars.html"
    features/step_definitions/jekyll_steps.rb:187
features/post_data.feature:28

Scenario: Use post.date variable

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    Star Wars
    2009-03-27
    simple
    Luke, I am your father.
  4. And I have a simple layout that contains "Post date: {{ page.date | date_to_string }}"
    features/step_definitions/jekyll_steps.rb:60
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "Post date: 27 Mar 2009" in "_site/2009/03/27/star-wars.html"
    features/step_definitions/jekyll_steps.rb:187
features/post_data.feature:39

Scenario: Use post.id variable

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    Star Wars
    2009-03-27
    simple
    Luke, I am your father.
  4. And I have a simple layout that contains "Post id: {{ page.id }}"
    features/step_definitions/jekyll_steps.rb:60
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "Post id: /2009/03/27/star-wars" in "_site/2009/03/27/star-wars.html"
    features/step_definitions/jekyll_steps.rb:187
features/post_data.feature:50

Scenario: Use post.content variable

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    Star Wars
    2009-03-27
    simple
    Luke, I am your father.
  4. And I have a simple layout that contains "Post content: {{ content }}"
    features/step_definitions/jekyll_steps.rb:60
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "Post content: <p>Luke, I am your father.</p>" in "_site/2009/03/27/star-wars.html"
    features/step_definitions/jekyll_steps.rb:187
features/post_data.feature:61

Scenario: Use post.categories variable when category is in a folder

  1. Given I have a movies directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a movies/_posts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  4. And I have the following post in "movies":
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    Star Wars
    2009-03-27
    simple
    Luke, I am your father.
  5. And I have a simple layout that contains "Post category: {{ page.categories }}"
    features/step_definitions/jekyll_steps.rb:60
  6. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  7. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  8. And I should see "Post category: movies" in "_site/movies/2009/03/27/star-wars.html"
    features/step_definitions/jekyll_steps.rb:187
features/post_data.feature:73

Scenario: Use post.categories variable when category is in a folder and has category in YAML

  1. Given I have a movies directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a movies/_posts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  4. And I have the following post in "movies":
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    category
    content
    Star Wars
    2009-03-27
    simple
    film
    Luke, I am your father.
  5. And I have a simple layout that contains "Post category: {{ page.categories }}"
    features/step_definitions/jekyll_steps.rb:60
  6. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  7. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  8. And I should see "Post category: movies" in "_site/movies/film/2009/03/27/star-wars.html"
    features/step_definitions/jekyll_steps.rb:187
features/post_data.feature:85

Scenario: Use post.categories variable when category is in a folder and has categories in YAML

  1. Given I have a movies directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a movies/_posts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  4. And I have the following post in "movies":
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    categories
    content
    Star Wars
    2009-03-27
    simple
    [film, scifi]
    Luke, I am your father.
  5. And I have a simple layout that contains "Post category: {{ page.categories }}"
    features/step_definitions/jekyll_steps.rb:60
  6. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  7. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  8. And I should see "Post category: movies" in "_site/movies/film/scifi/2009/03/27/star-wars.html"
    features/step_definitions/jekyll_steps.rb:187
features/post_data.feature:97

Scenario: Use post.categories variable when category is in a folder and duplicated category is in YAML

  1. Given I have a movies directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a movies/_posts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  4. And I have the following post in "movies":
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    category
    content
    Star Wars
    2009-03-27
    simple
    movies
    Luke, I am your father.
  5. And I have a simple layout that contains "Post category: {{ page.categories }}"
    features/step_definitions/jekyll_steps.rb:60
  6. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  7. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  8. And I should see "Post category: movies" in "_site/movies/2009/03/27/star-wars.html"
    features/step_definitions/jekyll_steps.rb:187
features/post_data.feature:109

Scenario: Use post.tags variable

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    tag
    content
    Star Wars
    2009-05-18
    simple
    twist
    Luke, I am your father.
  4. And I have a simple layout that contains "Post tags: {{ page.tags }}"
    features/step_definitions/jekyll_steps.rb:60
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "Post tags: twist" in "_site/2009/05/18/star-wars.html"
    features/step_definitions/jekyll_steps.rb:187
features/post_data.feature:120

Scenario: Use post.categories variable when categories are in folders

  1. Given I have a scifi directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a scifi/movies directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have a scifi/movies/_posts directory
    features/step_definitions/jekyll_steps.rb:82
  4. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  5. And I have the following post in "scifi/movies":
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    Star Wars
    2009-03-27
    simple
    Luke, I am your father.
  6. And I have a simple layout that contains "Post categories: {{ page.categories | array_to_sentence_string }}"
    features/step_definitions/jekyll_steps.rb:60
  7. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  8. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  9. And I should see "Post categories: scifi and movies" in "_site/scifi/movies/2009/03/27/star-wars.html"
    features/step_definitions/jekyll_steps.rb:187
features/post_data.feature:133

Scenario: Use post.categories variable when categories are in folders with mixed case

  1. Given I have a scifi directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a scifi/Movies directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have a scifi/Movies/_posts directory
    features/step_definitions/jekyll_steps.rb:82
  4. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  5. And I have the following post in "scifi/Movies":
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    Star Wars
    2009-03-27
    simple
    Luke, I am your father.
  6. And I have a simple layout that contains "Post categories: {{ page.categories | array_to_sentence_string }}"
    features/step_definitions/jekyll_steps.rb:60
  7. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  8. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  9. And I should see "Post categories: scifi and Movies" in "_site/scifi/movies/2009/03/27/star-wars.html"
    features/step_definitions/jekyll_steps.rb:187
features/post_data.feature:146

Scenario: Use post.categories variable when category is in YAML

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    category
    content
    Star Wars
    2009-03-27
    simple
    movies
    Luke, I am your father.
  4. And I have a simple layout that contains "Post category: {{ page.categories }}"
    features/step_definitions/jekyll_steps.rb:60
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "Post category: movies" in "_site/movies/2009/03/27/star-wars.html"
    features/step_definitions/jekyll_steps.rb:187
features/post_data.feature:157

Scenario: Use post.categories variable when category is in YAML and is mixed-case

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    category
    content
    Star Wars
    2009-03-27
    simple
    Movies
    Luke, I am your father.
  4. And I have a simple layout that contains "Post category: {{ page.categories }}"
    features/step_definitions/jekyll_steps.rb:60
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "Post category: Movies" in "_site/movies/2009/03/27/star-wars.html"
    features/step_definitions/jekyll_steps.rb:187
features/post_data.feature:168

Scenario: Use post.categories variable when categories are in YAML

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    categories
    content
    Star Wars
    2009-03-27
    simple
    ['scifi', 'movies']
    Luke, I am your father.
  4. And I have a simple layout that contains "Post categories: {{ page.categories | array_to_sentence_string }}"
    features/step_definitions/jekyll_steps.rb:60
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "Post categories: scifi and movies" in "_site/scifi/movies/2009/03/27/star-wars.html"
    features/step_definitions/jekyll_steps.rb:187
features/post_data.feature:179

Scenario: Use post.categories variable when categories are in YAML and are duplicated

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    categories
    content
    Star Wars
    2009-03-27
    simple
    ['movies', 'movies']
    Luke, I am your father.
  4. And I have a simple layout that contains "Post category: {{ page.categories }}"
    features/step_definitions/jekyll_steps.rb:60
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "Post category: movies" in "_site/movies/2009/03/27/star-wars.html"
    features/step_definitions/jekyll_steps.rb:187
features/post_data.feature:190

Scenario: Use post.categories variable when categories are in YAML with mixed case

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    categories
    content
    Star Wars
    2009-03-27
    simple
    ['scifi', 'Movies']
    Luke, I am your father.
    Star Trek
    2013-03-17
    simple
    ['SciFi', 'movies']
    Jean Luc, I am your father.
  4. And I have a simple layout that contains "Post categories: {{ page.categories | array_to_sentence_string }}"
    features/step_definitions/jekyll_steps.rb:60
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "Post categories: scifi and Movies" in "_site/scifi/movies/2009/03/27/star-wars.html"
    features/step_definitions/jekyll_steps.rb:187
  8. And I should see "Post categories: SciFi and movies" in "_site/scifi/movies/2013/03/17/star-trek.html"
    features/step_definitions/jekyll_steps.rb:187
features/post_data.feature:203

Scenario Outline: Use page.path variable

  1. Given I have a <dir>/_posts directory
    features/post_data.feature:204
  2. And I have the following post in "<dir>":
    features/post_data.feature:205
    title
    type
    date
    content
    my-post
    html
    2013-04-12
    Source path: {{ page.path }}
  3. When I run jekyll build
    features/post_data.feature:208
  4. Then the _site directory should exist
    features/post_data.feature:209
  5. And I should see "Source path: <path_prefix>_posts/2013-04-12-my-post.html" in "_site/<dir>/2013/04/12/my-post.html"
    features/post_data.feature:210

Examples

dir
path_prefix
.
dir
dir/
dir/nested
dir/nested/
features/post_data.feature:218

Scenario: Override page.path variable

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    path
    content
    override
    2013-04-12
    override-path.html
    Custom path: {{ page.path }}
  3. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  4. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  5. And I should see "Custom path: override-path.html" in "_site/2013/04/12/override.html"
    features/step_definitions/jekyll_steps.rb:187
features/post_data.feature:227

Scenario: Disable a post from being published

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have an "index.html" file that contains "Published!"
    features/step_definitions/jekyll_steps.rb:54
  3. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    published
    content
    Star Wars
    2009-03-27
    simple
    false
    Luke, I am your father.
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And the "_site/2009/03/27/star-wars.html" file should not exist
    features/step_definitions/jekyll_steps.rb:215
  7. And I should see "Published!" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/post_data.feature:238

Scenario: Use a custom variable

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    author
    content
    Star Wars
    2009-03-27
    simple
    Darth Vader
    Luke, I am your father.
  4. And I have a simple layout that contains "Post author: {{ page.author }}"
    features/step_definitions/jekyll_steps.rb:60
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "Post author: Darth Vader" in "_site/2009/03/27/star-wars.html"
    features/step_definitions/jekyll_steps.rb:187
features/post_data.feature:249

Scenario: Previous and next posts title

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    author
    content
    Star Wars
    2009-03-27
    ordered
    Darth Vader
    Luke, I am your father.
    Some like it hot
    2009-04-27
    ordered
    Osgood
    Nobody is perfect.
    Terminator
    2009-05-27
    ordered
    Arnold
    Sayonara, baby
  4. And I have a ordered layout that contains "Previous post: {{ page.previous.title }} and next post: {{ page.next.title }}"
    features/step_definitions/jekyll_steps.rb:60
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should see "next post: Some like it hot" in "_site/2009/03/27/star-wars.html"
    features/step_definitions/jekyll_steps.rb:187
  8. And I should see "Previous post: Some like it hot" in "_site/2009/05/27/terminator.html"
    features/step_definitions/jekyll_steps.rb:187

Feature: Post excerpts

As a hacker who likes to blog
I want to be able to make a static site
In order to share my awesome ideas with the interwebs
But some people can only focus for a few moments
So just give them a taste

features/post_excerpts.feature:8

Scenario: An excerpt without a layout

  1. Given I have an "index.html" page that contains "{% for post in site.posts %}{{ post.excerpt }}{% endfor %}"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    entry1
    2007-12-31
    post
    content for entry1.
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see exactly "<p>content for entry1.</p>" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:191
features/post_excerpts.feature:18

Scenario: An excerpt from a post with a layout

  1. Given I have an "index.html" page that contains "{% for post in site.posts %}{{ post.excerpt }}{% endfor %}"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  4. And I have a post layout that contains "{{ page.excerpt }}"
    features/step_definitions/jekyll_steps.rb:60
  5. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    entry1
    2007-12-31
    post
    content for entry1.
  6. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  7. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  8. And the _site/2007 directory should exist
    features/step_definitions/jekyll_steps.rb:179
  9. And the _site/2007/12 directory should exist
    features/step_definitions/jekyll_steps.rb:179
  10. And the _site/2007/12/31 directory should exist
    features/step_definitions/jekyll_steps.rb:179
  11. And the "_site/2007/12/31/entry1.html" file should exist
    features/step_definitions/jekyll_steps.rb:203
  12. And I should see exactly "<p>content for entry1.</p>" in "_site/2007/12/31/entry1.html"
    features/step_definitions/jekyll_steps.rb:191
  13. And I should see exactly "<p>content for entry1.</p>" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:191
features/post_excerpts.feature:35

Scenario: An excerpt from a post with a layout which has context

  1. Given I have an "index.html" page that contains "{% for post in site.posts %}{{ post.excerpt }}{% endfor %}"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  4. And I have a post layout that contains "<html><head></head><body>{{ page.excerpt }}</body></html>"
    features/step_definitions/jekyll_steps.rb:60
  5. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    entry1
    2007-12-31
    post
    content for entry1.
  6. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  7. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  8. And the _site/2007 directory should exist
    features/step_definitions/jekyll_steps.rb:179
  9. And the _site/2007/12 directory should exist
    features/step_definitions/jekyll_steps.rb:179
  10. And the _site/2007/12/31 directory should exist
    features/step_definitions/jekyll_steps.rb:179
  11. And the "_site/2007/12/31/entry1.html" file should exist
    features/step_definitions/jekyll_steps.rb:203
  12. And I should see "<p>content for entry1.</p>" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  13. And I should see "<html><head></head><body><p>content for entry1.</p>\n\n</body></html>" in "_site/2007/12/31/entry1.html"
    features/step_definitions/jekyll_steps.rb:187

Feature: Rendering

As a hacker who likes to blog
I want to be able to make a static site
In order to share my awesome ideas with the interwebs
But I want to make it as simply as possible
So render with Liquid and place in Layouts

features/rendering.feature:8

Scenario: Render Liquid and place in layout

  1. Given I have a "index.html" page with layout "simple" that contains "Hi there, Jekyll {{ jekyll.environment }}!"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have a simple layout that contains "{{ content }}Ahoy, indeed!"
    features/step_definitions/jekyll_steps.rb:60
  3. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  4. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  5. And I should see "Hi there, Jekyll development!\nAhoy, indeed" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/rendering.feature:15

Scenario: Don't place asset files in layout

  1. Given I have an "index.scss" page with layout "simple" that contains ".foo-bar { color:black; }"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have an "index.coffee" page with layout "simple" that contains "whatever()"
    features/step_definitions/jekyll_steps.rb:43
  3. And I have a configuration file with "gems" set to "[jekyll-coffeescript]"
    features/step_definitions/jekyll_steps.rb:112
  4. And I have a simple layout that contains "{{ content }}Ahoy, indeed!"
    features/step_definitions/jekyll_steps.rb:60
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  7. And I should not see "Ahoy, indeed!" in "_site/index.css"
    features/step_definitions/jekyll_steps.rb:195
  8. And I should not see "Ahoy, indeed!" in "_site/index.js"
    features/step_definitions/jekyll_steps.rb:195
features/rendering.feature:25

Scenario: Render liquid in Sass

  1. Given I have an "index.scss" page that contains ".foo-bar { color:{{site.color}}; }"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have a configuration file with "color" set to "red"
    features/step_definitions/jekyll_steps.rb:112
  3. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  4. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  5. And I should see ".foo-bar {\n color: red; }" in "_site/index.css"
    features/step_definitions/jekyll_steps.rb:187
features/rendering.feature:32

Scenario: Not render liquid in CoffeeScript without explicitly including jekyll-coffeescript

  1. Given I have an "index.coffee" page with animal "cicada" that contains "hey='for {{page.animal}}'"
    features/step_definitions/jekyll_steps.rb:43
  2. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  3. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  4. And the "_site/index.js" file should not exist
    features/step_definitions/jekyll_steps.rb:215
features/rendering.feature:38

Scenario: Render liquid in CoffeeScript with jekyll-coffeescript enabled

  1. Given I have an "index.coffee" page with animal "cicada" that contains "hey='for {{page.animal}}'"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have a configuration file with "gems" set to "[jekyll-coffeescript]"
    features/step_definitions/jekyll_steps.rb:112
  3. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  4. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  5. And I should see "hey = 'for cicada';" in "_site/index.js"
    features/step_definitions/jekyll_steps.rb:187

Feature: Site configuration

As a hacker who likes to blog
I want to be able to configure jekyll
In order to make setting up a site easier

features/site_configuration.feature:6

Scenario: Change source directory

  1. Given I have a blank site in "_sourcedir"
    features/step_definitions/jekyll_steps.rb:34
  2. And I have an "_sourcedir/index.html" file that contains "Changing source directory"
    features/step_definitions/jekyll_steps.rb:54
  3. And I have a configuration file with "source" set to "_sourcedir"
    features/step_definitions/jekyll_steps.rb:112
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "Changing source directory" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/site_configuration.feature:14

Scenario: Change destination directory

  1. Given I have an "index.html" file that contains "Changing destination directory"
    features/step_definitions/jekyll_steps.rb:54
  2. And I have a configuration file with "destination" set to "_mysite"
    features/step_definitions/jekyll_steps.rb:112
  3. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  4. Then the _mysite directory should exist
    features/step_definitions/jekyll_steps.rb:179
  5. And I should see "Changing destination directory" in "_mysite/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/site_configuration.feature:21

Scenario Outline: Similarly named source and destination

  1. Given I have a blank site in "<source>"
    features/site_configuration.feature:22
  2. And I have an "<source>/index.md" page that contains "markdown"
    features/site_configuration.feature:23
  3. And I have a configuration file with:
    features/site_configuration.feature:24
    key
    value
    source
    <source>
    destination
    <dest>
  4. When I run jekyll build
    features/site_configuration.feature:28
  5. Then the <source> directory should exist
    features/site_configuration.feature:29
  6. And the "<dest>/index.html" file should <file_exist> exist
    features/site_configuration.feature:30
  7. And I should see "markdown" in "<source>/index.md"
    features/site_configuration.feature:31

Examples

source
dest
file_exist
mysite_source
mysite
mysite
mysite_dest
mysite/
mysite
not
mysite
./mysite
not
mysite/source
mysite
not
mysite
mysite/dest
features/site_configuration.feature:42

Scenario: Exclude files inline

  1. Given I have an "Rakefile" file that contains "I want to be excluded"
    features/step_definitions/jekyll_steps.rb:54
  2. And I have an "README" file that contains "I want to be excluded"
    features/step_definitions/jekyll_steps.rb:54
  3. And I have an "index.html" file that contains "I want to be included"
    features/step_definitions/jekyll_steps.rb:54
  4. And I have a configuration file with "exclude" set to "['Rakefile', 'README']"
    features/step_definitions/jekyll_steps.rb:112
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then I should see "I want to be included" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  7. And the "_site/Rakefile" file should not exist
    features/step_definitions/jekyll_steps.rb:215
  8. And the "_site/README" file should not exist
    features/step_definitions/jekyll_steps.rb:215
features/site_configuration.feature:52

Scenario: Exclude files with YAML array

  1. Given I have an "Rakefile" file that contains "I want to be excluded"
    features/step_definitions/jekyll_steps.rb:54
  2. And I have an "README" file that contains "I want to be excluded"
    features/step_definitions/jekyll_steps.rb:54
  3. And I have an "index.html" file that contains "I want to be included"
    features/step_definitions/jekyll_steps.rb:54
  4. And I have a configuration file with "exclude" set to:
    features/step_definitions/jekyll_steps.rb:126
    value
    README
    Rakefile
  5. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  6. Then I should see "I want to be included" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  7. And the "_site/Rakefile" file should not exist
    features/step_definitions/jekyll_steps.rb:215
  8. And the "_site/README" file should not exist
    features/step_definitions/jekyll_steps.rb:215
features/site_configuration.feature:65

Scenario: Use RDiscount for markup

  1. Given I have an "index.markdown" page that contains "[Google](http://google.com)"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have a configuration file with "markdown" set to "rdiscount"
    features/step_definitions/jekyll_steps.rb:112
  3. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  4. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  5. And I should see "<a href=\"http://google.com\">Google</a>" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/site_configuration.feature:72

Scenario: Use Kramdown for markup

  1. Given I have an "index.markdown" page that contains "[Google](http://google.com)"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have a configuration file with "markdown" set to "kramdown"
    features/step_definitions/jekyll_steps.rb:112
  3. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  4. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  5. And I should see "<a href=\"http://google.com\">Google</a>" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/site_configuration.feature:79

Scenario: Use Redcarpet for markup

  1. Given I have an "index.markdown" page that contains "[Google](http://google.com)"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have a configuration file with "markdown" set to "redcarpet"
    features/step_definitions/jekyll_steps.rb:112
  3. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  4. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  5. And I should see "<a href=\"http://google.com\">Google</a>" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/site_configuration.feature:86

Scenario: Highlight code with pygments

  1. Given I have an "index.html" page that contains "{% highlight ruby %} puts 'Hello world!' {% endhighlight %}"
    features/step_definitions/jekyll_steps.rb:43
  2. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  3. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  4. And I should see "Hello world!" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  5. And I should see "class=\"highlight\"" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/site_configuration.feature:93

Scenario: Highlight code with rouge

  1. Given I have an "index.html" page that contains "{% highlight ruby %} puts 'Hello world!' {% endhighlight %}"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have a configuration file with "highlighter" set to "rouge"
    features/step_definitions/jekyll_steps.rb:112
  3. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  4. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  5. And I should see "Hello world!" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  6. And I should see "class=\"highlight\"" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/site_configuration.feature:101

Scenario: Rouge renders code block once

  1. Given I have a configuration file with "highlighter" set to "rouge"
    features/step_definitions/jekyll_steps.rb:112
  2. And I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  3. And I have the following post:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    foo
    2014-04-27 11:34
    default
    {% highlight text %} test {% endhighlight %}
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then I should not see "highlight(.*)highlight" in "_site/2014/04/27/foo.html"
    features/step_definitions/jekyll_steps.rb:195
features/site_configuration.feature:110

Scenario: Set time and no future dated posts

  1. Given I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a page layout that contains "Page Layout: {{ site.posts.size }} on {{ site.time | date: "%Y-%m-%d" }}"
    features/step_definitions/jekyll_steps.rb:60
  3. And I have a post layout that contains "Post Layout: {{ content }}"
    features/step_definitions/jekyll_steps.rb:60
  4. And I have an "index.html" page with layout "page" that contains "site index page"
    features/step_definitions/jekyll_steps.rb:43
  5. And I have a configuration file with:
    features/step_definitions/jekyll_steps.rb:118
    key
    value
    time
    2010-01-01
    future
    false
  6. And I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  7. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    entry1
    2007-12-31
    post
    content for entry1.
    entry2
    2020-01-31
    post
    content for entry2.
  8. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  9. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  10. And I should see "Page Layout: 1 on 2010-01-01" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  11. And I should see "Post Layout: <p>content for entry1.</p>" in "_site/2007/12/31/entry1.html"
    features/step_definitions/jekyll_steps.rb:187
  12. And the "_site/2020/01/31/entry2.html" file should not exist
    features/step_definitions/jekyll_steps.rb:215
features/site_configuration.feature:130

Scenario: Set time and future dated posts allowed

  1. Given I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a page layout that contains "Page Layout: {{ site.posts.size }} on {{ site.time | date: "%Y-%m-%d" }}"
    features/step_definitions/jekyll_steps.rb:60
  3. And I have a post layout that contains "Post Layout: {{ content }}"
    features/step_definitions/jekyll_steps.rb:60
  4. And I have an "index.html" page with layout "page" that contains "site index page"
    features/step_definitions/jekyll_steps.rb:43
  5. And I have a configuration file with:
    features/step_definitions/jekyll_steps.rb:118
    key
    value
    time
    2010-01-01
    future
    true
  6. And I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  7. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    entry1
    2007-12-31
    post
    content for entry1.
    entry2
    2020-01-31
    post
    content for entry2.
  8. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  9. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  10. And I should see "Page Layout: 2 on 2010-01-01" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  11. And I should see "Post Layout: <p>content for entry1.</p>" in "_site/2007/12/31/entry1.html"
    features/step_definitions/jekyll_steps.rb:187
  12. And I should see "Post Layout: <p>content for entry2.</p>" in "_site/2020/01/31/entry2.html"
    features/step_definitions/jekyll_steps.rb:187
features/site_configuration.feature:150

Scenario: Generate proper dates with explicitly set timezone (same as posts' time)

  1. Given I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a page layout that contains "Page Layout: {{ site.posts.size }}"
    features/step_definitions/jekyll_steps.rb:60
  3. And I have a post layout that contains "Post Layout: {{ content }} built at {{ page.date | date_to_xmlschema }}"
    features/step_definitions/jekyll_steps.rb:60
  4. And I have an "index.html" page with layout "page" that contains "site index page"
    features/step_definitions/jekyll_steps.rb:43
  5. And I have a configuration file with:
    features/step_definitions/jekyll_steps.rb:118
    key
    value
    timezone
    America/New_York
  6. And I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  7. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    entry1
    2013-04-09 23:22 -0400
    post
    content for entry1.
    entry2
    2013-04-10 03:14 -0400
    post
    content for entry2.
  8. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  9. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  10. And I should see "Page Layout: 2" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  11. And I should see "Post Layout: <p>content for entry1.</p>\n built at 2013-04-09T23:22:00-04:00" in "_site/2013/04/09/entry1.html"
    features/step_definitions/jekyll_steps.rb:187
  12. And I should see "Post Layout: <p>content for entry2.</p>\n built at 2013-04-10T03:14:00-04:00" in "_site/2013/04/10/entry2.html"
    features/step_definitions/jekyll_steps.rb:187
features/site_configuration.feature:169

Scenario: Generate proper dates with explicitly set timezone (different than posts' time)

  1. Given I have a _layouts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a page layout that contains "Page Layout: {{ site.posts.size }}"
    features/step_definitions/jekyll_steps.rb:60
  3. And I have a post layout that contains "Post Layout: {{ content }} built at {{ page.date | date_to_xmlschema }}"
    features/step_definitions/jekyll_steps.rb:60
  4. And I have an "index.html" page with layout "page" that contains "site index page"
    features/step_definitions/jekyll_steps.rb:43
  5. And I have a configuration file with:
    features/step_definitions/jekyll_steps.rb:118
    key
    value
    timezone
    Pacific/Honolulu
  6. And I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  7. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    entry1
    2013-04-09 23:22 +0400
    post
    content for entry1.
    entry2
    2013-04-10 03:14 +0400
    post
    content for entry2.
  8. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  9. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  10. And I should see "Page Layout: 2" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  11. And the "_site/2013/04/09/entry1.html" file should exist
    features/step_definitions/jekyll_steps.rb:203
  12. And the "_site/2013/04/09/entry2.html" file should exist
    features/step_definitions/jekyll_steps.rb:203
  13. And I should see "Post Layout: <p>content for entry1.</p>\n built at 2013-04-09T09:22:00-10:00" in "_site/2013/04/09/entry1.html"
    features/step_definitions/jekyll_steps.rb:187
  14. And I should see "Post Layout: <p>content for entry2.</p>\n built at 2013-04-09T13:14:00-10:00" in "_site/2013/04/09/entry2.html"
    features/step_definitions/jekyll_steps.rb:187
features/site_configuration.feature:190

Scenario: Limit the number of posts generated by most recent date

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a configuration file with:
    features/step_definitions/jekyll_steps.rb:118
    key
    value
    limit_posts
    2
  3. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    content
    Apples
    2009-03-27
    An article about apples
    Oranges
    2009-04-01
    An article about oranges
    Bananas
    2009-04-05
    An article about bananas
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And the "_site/2009/04/05/bananas.html" file should exist
    features/step_definitions/jekyll_steps.rb:203
  7. And the "_site/2009/04/01/oranges.html" file should exist
    features/step_definitions/jekyll_steps.rb:203
  8. And the "_site/2009/03/27/apples.html" file should not exist
    features/step_definitions/jekyll_steps.rb:215
features/site_configuration.feature:206

Scenario: Copy over normally excluded files when they are explicitly included

  1. Given I have a ".gitignore" file that contains ".DS_Store"
    features/step_definitions/jekyll_steps.rb:54
  2. And I have an ".htaccess" file that contains "SomeDirective"
    features/step_definitions/jekyll_steps.rb:54
  3. And I have a configuration file with "include" set to:
    features/step_definitions/jekyll_steps.rb:126
    value
    .gitignore
    .foo
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see ".DS_Store" in "_site/.gitignore"
    features/step_definitions/jekyll_steps.rb:187
  7. And the "_site/.htaccess" file should not exist
    features/step_definitions/jekyll_steps.rb:215
features/site_configuration.feature:218

Scenario: Using a different layouts directory

  1. Given I have a _theme directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have a page theme that contains "Page Layout: {{ site.posts.size }} on {{ site.time | date: "%Y-%m-%d" }}"
    features/step_definitions/jekyll_steps.rb:60
  3. And I have a post theme that contains "Post Layout: {{ content }}"
    features/step_definitions/jekyll_steps.rb:60
  4. And I have an "index.html" page with layout "page" that contains "site index page"
    features/step_definitions/jekyll_steps.rb:43
  5. And I have a configuration file with:
    features/step_definitions/jekyll_steps.rb:118
    key
    value
    time
    2010-01-01
    future
    true
    layouts
    _theme
  6. And I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  7. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    layout
    content
    entry1
    2007-12-31
    post
    content for entry1.
    entry2
    2020-01-31
    post
    content for entry2.
  8. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  9. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  10. And I should see "Page Layout: 2 on 2010-01-01" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  11. And I should see "Post Layout: <p>content for entry1.</p>" in "_site/2007/12/31/entry1.html"
    features/step_definitions/jekyll_steps.rb:187
  12. And I should see "Post Layout: <p>content for entry2.</p>" in "_site/2020/01/31/entry2.html"
    features/step_definitions/jekyll_steps.rb:187
features/site_configuration.feature:239

Scenario: arbitrary file reads via layouts

  1. Given I have an "index.html" page with layout "page" that contains "FOO"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have a "_config.yml" file that contains "layouts: '../../../../../../../../../../../../../../usr/include'"
    features/step_definitions/jekyll_steps.rb:54
  3. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  4. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  5. And I should see "FOO" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
  6. And I should not see " " in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:195

Feature: Site data

As a hacker who likes to blog
I want to be able to embed data into my site
In order to make the site slightly dynamic

features/site_data.feature:6

Scenario: Use page variable in a page

  1. Given I have an "contact.html" page with title "Contact" that contains "{{ page.title }}: email@example.com"
    features/step_definitions/jekyll_steps.rb:43
  2. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  3. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  4. And I should see "Contact: email@example.com" in "_site/contact.html"
    features/step_definitions/jekyll_steps.rb:187
features/site_data.feature:12

Scenario Outline: Use page.path variable in a page

  1. Given I have a <dir> directory
    features/site_data.feature:13
  2. And I have a "<path>" page that contains "Source path: {{ page.path }}"
    features/site_data.feature:14
  3. When I run jekyll build
    features/site_data.feature:15
  4. Then the _site directory should exist
    features/site_data.feature:16
  5. And I should see "Source path: <path>" in "_site/<path>"
    features/site_data.feature:17

Examples

dir
path
.
index.html
dir
dir/about.html
dir/nested
dir/nested/page.html
features/site_data.feature:25

Scenario: Override page.path

  1. Given I have an "override.html" page with path "custom-override.html" that contains "Custom path: {{ page.path }}"
    features/step_definitions/jekyll_steps.rb:43
  2. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  3. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  4. And I should see "Custom path: custom-override.html" in "_site/override.html"
    features/step_definitions/jekyll_steps.rb:187
features/site_data.feature:31

Scenario: Use site.time variable

  1. Given I have an "index.html" page that contains "{{ site.time }}"
    features/step_definitions/jekyll_steps.rb:43
  2. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  3. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  4. And I should see today's time in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:219
features/site_data.feature:37

Scenario: Use site.posts variable for latest post

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have an "index.html" page that contains "{{ site.posts.first.title }}: {{ site.posts.first.url }}"
    features/step_definitions/jekyll_steps.rb:43
  3. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    content
    First Post
    2009-03-25
    My First Post
    Second Post
    2009-03-26
    My Second Post
    Third Post
    2009-03-27
    My Third Post
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "Third Post: /2009/03/27/third-post.html" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/site_data.feature:49

Scenario: Use site.posts variable in a loop

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have an "index.html" page that contains "{% for post in site.posts %} {{ post.title }} {% endfor %}"
    features/step_definitions/jekyll_steps.rb:43
  3. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    content
    First Post
    2009-03-25
    My First Post
    Second Post
    2009-03-26
    My Second Post
    Third Post
    2009-03-27
    My Third Post
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "Third Post Second Post First Post" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/site_data.feature:61

Scenario: Use site.categories.code variable

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have an "index.html" page that contains "{% for post in site.categories.code %} {{ post.title }} {% endfor %}"
    features/step_definitions/jekyll_steps.rb:43
  3. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    category
    content
    Awesome Hack
    2009-03-26
    code
    puts 'Hello World'
    Delicious Beer
    2009-03-26
    food
    1) Yuengling
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "Awesome Hack" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/site_data.feature:72

Scenario: Use site.tags variable

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have an "index.html" page that contains "{% for post in site.tags.beer %} {{ post.content }} {% endfor %}"
    features/step_definitions/jekyll_steps.rb:43
  3. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    tag
    content
    Delicious Beer
    2009-03-26
    beer
    1) Yuengling
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "Yuengling" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/site_data.feature:82

Scenario: Order Posts by name when on the same date

  1. Given I have a _posts directory
    features/step_definitions/jekyll_steps.rb:82
  2. And I have an "index.html" page that contains "{% for post in site.posts %}{{ post.title }}:{{ post.previous.title}},{{ post.next.title}} {% endfor %}"
    features/step_definitions/jekyll_steps.rb:43
  3. And I have the following posts:
    features/step_definitions/jekyll_steps.rb:86
    title
    date
    content
    first
    2009-02-26
    first
    A
    2009-03-26
    A
    B
    2009-03-26
    B
    C
    2009-03-26
    C
    last
    2009-04-26
    last
  4. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  5. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  6. And I should see "last:C, C:B,last B:A,C A:first,B first:,A" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/site_data.feature:96

Scenario: Use configuration date in site payload

  1. Given I have an "index.html" page that contains "{{ site.url }}"
    features/step_definitions/jekyll_steps.rb:43
  2. And I have a configuration file with "url" set to "http://example.com"
    features/step_definitions/jekyll_steps.rb:112
  3. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  4. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  5. And I should see "http://example.com" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187
features/site_data.feature:103

Scenario: Access Jekyll version via jekyll.version

  1. Given I have an "index.html" page that contains "{{ jekyll.version }}"
    features/step_definitions/jekyll_steps.rb:43
  2. When I run jekyll build
    features/step_definitions/jekyll_steps.rb:149
  3. Then the _site directory should exist
    features/step_definitions/jekyll_steps.rb:179
  4. And I should see "\d+\.\d+\.\d+" in "_site/index.html"
    features/step_definitions/jekyll_steps.rb:187