This repository has been archived by the owner on Mar 24, 2021. It is now read-only.
forked from jekyll/jekyll
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
17 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,23 +4,20 @@ Feature: Site data | |
In order to make the site slightly dynamic | ||
|
||
Scenario: Use page variable in a page | ||
Given I have a blank site | ||
And I have an "contact.html" file with title "Contact" that contains "{{ page.title }}: [email protected]" | ||
Given I have an "contact.html" page with title "Contact" that contains "{{ page.title }}: [email protected]" | ||
When I run jekyll | ||
Then the _site directory should exist | ||
And I should see "Contact: [email protected]" in "_site/index.html" | ||
And I should see "Contact: [email protected]" in "_site/contact.html" | ||
|
||
Scenario: Use site.time variable | ||
Given I have a blank site | ||
And I have an "index.html" file that contains "Generated on: {{ site.time }}" | ||
Given I have an "index.html" page that contains "Generated on: {{ site.time }}" | ||
When I run jekyll | ||
Then the _site directory should exist | ||
And I should see "Generated on: #{Date.today.strftime('%Y-%m-%d')}" in "_site/index.html" | ||
And I should see today's time in "_site/index.html" | ||
|
||
Scenario: Use site.posts variable for latest post | ||
Given I have a blank site | ||
And I have a _posts directory | ||
And I have an "index.html" file that contains "{{ site.posts.first.title }}: {{ site.posts.first.url }}" | ||
Given I have a _posts directory | ||
And I have an "index.html" page that contains "{{ site.posts.first.title }}: {{ site.posts.first.url }}" | ||
And I have the following posts: | ||
| title | date | content | | ||
| First Post | 3/25/2009 | My First Post | | ||
|
@@ -31,22 +28,20 @@ Feature: Site data | |
And I should see "Third Post: /2009/03/27/third-post.html" in "_site/index.html" | ||
|
||
Scenario: Use site.posts variable in a loop | ||
Given I have a blank site | ||
And I have a _posts directory | ||
And I have an "index.html" file that contains "{% for post in site.posts %} {{ post.title }} {% endfor %}" | ||
Given I have a _posts directory | ||
And I have an "index.html" page that contains "{% for post in site.posts %} {{ post.title }} {% endfor %}" | ||
And I have the following posts: | ||
| title | date | content | | ||
| First Post | 3/25/2009 | My First Post | | ||
| Second Post | 3/26/2009 | My Second Post | | ||
| Third Post | 3/27/2009 | My Third Post | | ||
When I run jekyll | ||
Then the _site directory should exist | ||
And I should see "Third Post Second Post First Post" in "_site/index.html" | ||
And I should see "Third Post Second Post First Post" in "_site/index.html" | ||
|
||
Scenario: Use site.categories.code variable | ||
Given I have a blank site | ||
And I have a _posts directory | ||
And I have an "index.html" file that contains "{% for post in site.categories.code %} {{ post.title }} {% endfor %}" | ||
Given I have a _posts directory | ||
And I have an "index.html" page that contains "{% for post in site.categories.code %} {{ post.title }} {% endfor %}" | ||
And I have the following posts: | ||
| title | date | category | content | | ||
| Awesome Hack | 3/26/2009 | code | puts 'Hello World' | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters