jekyll 2.0.0.alpha.3 → 2.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of jekyll might be problematic. Click here for more details.

Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.markdown +1 -1
  3. data/History.markdown +10 -0
  4. data/features/collections.feature +49 -15
  5. data/features/create_sites.feature +16 -16
  6. data/features/data.feature +4 -4
  7. data/features/drafts.feature +4 -4
  8. data/features/embed_filters.feature +6 -6
  9. data/features/frontmatter_defaults.feature +79 -0
  10. data/features/include_tag.feature +4 -4
  11. data/features/markdown.feature +4 -4
  12. data/features/pagination.feature +3 -3
  13. data/features/permalinks.feature +8 -8
  14. data/features/post_data.feature +18 -18
  15. data/features/post_excerpts.feature +3 -3
  16. data/features/site_configuration.feature +21 -21
  17. data/features/site_data.feature +11 -11
  18. data/features/step_definitions/jekyll_steps.rb +5 -18
  19. data/features/support/env.rb +2 -15
  20. data/lib/jekyll.rb +2 -0
  21. data/lib/jekyll/collection.rb +30 -4
  22. data/lib/jekyll/configuration.rb +2 -1
  23. data/lib/jekyll/convertible.rb +15 -1
  24. data/lib/jekyll/document.rb +11 -7
  25. data/lib/jekyll/filters.rb +1 -1
  26. data/lib/jekyll/frontmatter_defaults.rb +148 -0
  27. data/lib/jekyll/liquid_extensions.rb +22 -0
  28. data/lib/jekyll/page.rb +5 -0
  29. data/lib/jekyll/post.rb +12 -0
  30. data/lib/jekyll/site.rb +42 -27
  31. data/lib/jekyll/version.rb +1 -1
  32. data/script/test +11 -0
  33. data/site/docs/collections.md +78 -5
  34. data/site/docs/configuration.md +49 -0
  35. data/site/docs/frontmatter.md +10 -0
  36. data/site/docs/plugins.md +1 -0
  37. data/site/docs/posts.md +9 -0
  38. data/site/docs/sites.md +2 -2
  39. data/site/docs/templates.md +1 -1
  40. data/test/test_collections.rb +50 -4
  41. data/test/test_filters.rb +4 -0
  42. data/test/test_liquid_extensions.rb +31 -0
  43. data/test/test_utils.rb +1 -0
  44. metadata +9 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b45529d71bc0001091dfa655841e96119ed3249
4
- data.tar.gz: b92696779305cc5c63a173a19b078a3806c6a8ca
3
+ metadata.gz: b7bc4a3e8b5ff2166ff4085233990a3e812f939c
4
+ data.tar.gz: 15c66ce3e4d6382e030edbaf94de50fb7f8f25f4
5
5
  SHA512:
6
- metadata.gz: ccab5f03c28fdc500cc78880b346fb1041296e75de800d10f0d9cf58c7d0b8ef89617c52a2c00e02cb5726c1bf541bd3c714bac2fee2f9cafd3f710977c65963
7
- data.tar.gz: 6aa322546770c3f82a1f34beb9c195da8258111ff44cc6f1eadf1a1f72f88f87739277696ac91a2726c5b84952eca10306b04b7191c2fe4f96652719102af892
6
+ metadata.gz: 17f3e2ca1a1eff87d94a83b200110abc916bad8cd7e0547d1adece084baf5427fdfefe275261f22a91c8107c286a7c4c28178175af1dfc95cbad29e0bf4c6529
7
+ data.tar.gz: 6628f451773ee299076c5ca366c253357f78f7292e9bc06a96f9d547b20da89f1afca053da7ad590d8c320d81728eb154868d5a3e3ffbcfcb550f5623448f8a1
@@ -8,7 +8,7 @@ following in mind:
8
8
  * If you're creating a small fix or patch to an existing feature, just a simple
9
9
  test will do. Please stay in the confines of the current test suite and use
10
10
  [Shoulda](http://github.com/thoughtbot/shoulda/tree/master) and
11
- [RR](http://github.com/btakita/rr/tree/master).
11
+ [RR](https://github.com/rr/rr).
12
12
  * If it's a brand new feature, make sure to create a new
13
13
  [Cucumber](https://github.com/cucumber/cucumber/) feature and reuse steps
14
14
  where appropriate. Also, whipping up some documentation in your fork's `site`
@@ -17,6 +17,7 @@
17
17
  * Expose `site.static_files` to Liquid (#2075)
18
18
  * Complete redesign of the template site generated by `jekyll new` (#2050)
19
19
  * Update Listen from 1.x to 2.x (#2097)
20
+ * Front-matter defaults (#2205)
20
21
 
21
22
  ### Minor Enhancements
22
23
  * Move the EntryFilter class into the Jekyll module to avoid polluting the
@@ -61,6 +62,8 @@
61
62
  * Use `File.exist?` instead of deprecated `File.exists?` (#2214)
62
63
  * Require newline after start of YAML front-matter header (#2211)
63
64
  * Add the ability for pages to be marked as `published: false` (#1492)
65
+ * Add `Jekyll::LiquidExtensions` with `.lookup_variable` method for easy
66
+ looking up of variable values in a Liquid context. (#2253)
64
67
 
65
68
  ### Bug Fixes
66
69
  * Don't allow nil entries when loading posts (#1796)
@@ -90,6 +93,8 @@
90
93
  * Fix `Post#url` and `Page#url` escape (#1568)
91
94
  * Strip newlines from the `{% highlight %}` block content (#1823)
92
95
  * Load in `rouge` only when it's been requested as the highlighter (#2189)
96
+ * Convert input to string before XML escaping (`xml_escape` liquid filter) (#2244)
97
+ * Modify configuration key for Collections and reset properly. (#2238)
93
98
 
94
99
  ### Development Fixes
95
100
  * Add a link to the site in the README.md file (#1795)
@@ -119,6 +124,8 @@
119
124
  * Refactor tags and categories (#1639)
120
125
  * Extract plugin management into its own class (#2197)
121
126
  * Add missing tests for `Command` (#2216)
127
+ * Update `rr` link in CONTRIBUTING doc (#2247)
128
+ * Streamline cucumber execution of `jekyll` subcommands (#2258)
122
129
 
123
130
  ### Site Enhancements
124
131
  * Document Kramdown's GFM parser option (#1791)
@@ -186,6 +193,9 @@
186
193
  * Remove duplicate entry in list of third-party plugins (#2206)
187
194
  * Reduce the whitespace in the favicon. (#2213)
188
195
  * Add `jekyll-page-collections` to list of third-party plugins (#2215)
196
+ * Add a cross-reference about `post_url` (#2243)
197
+ * Add `jekyll-live-tiles` to list of third-party plugins (#2250)
198
+ * Fixed broken link to GitHub training material site source (#2257)
189
199
 
190
200
  ## 1.5.1 / 2014-03-27
191
201
 
@@ -7,32 +7,66 @@ Feature: Collections
7
7
  Given I have an "index.html" page that contains "Collections: {{ site.methods }}"
8
8
  And I have fixture collections
9
9
  And I have a configuration file with "collections" set to "['methods']"
10
- When I run jekyll
10
+ When I run jekyll build
11
11
  Then the _site directory should exist
12
- And I should see "Collections: Use `{{ page.title }}` to build a full configuration for use w/Jekyll.\n\nWhatever: {{ page.whatever }}\n`{{ page.title }}` is used to make sure your path is in your source.\nRun your generators! {{ page.layout }}\nCreate dat site.\nRun your generators! {{ page.layout }}" in "_site/index.html"
12
+ 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><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>Create dat site.</p>\n<p>Run your generators! default</p>" in "_site/index.html"
13
+ And the "_site/methods/configuration.html" file should not exist
13
14
 
14
15
  Scenario: Rendered collection
15
16
  Given I have an "index.html" page that contains "Collections: {{ site.collections }}"
17
+ And I have an "collection_metadata.html" page that contains "Methods metadata: {{ site.collections.methods.foo }} {{ site.collections.methods }}"
16
18
  And I have fixture collections
17
- And I have a configuration file with:
18
- | key | value |
19
- | collections | ['methods'] |
20
- | render | ['methods'] |
21
- When I run jekyll
19
+ And I have a "_config.yml" file with content:
20
+ """
21
+ collections:
22
+ methods:
23
+ output: true
24
+ foo: bar
25
+ """
26
+ When I run jekyll build
22
27
  Then the _site directory should exist
23
- And I should see "Collections: methods" in "_site/index.html"
28
+ And I should see "Collections: {\"methods" in "_site/index.html"
29
+ And I should see "Methods metadata: bar" in "_site/collection_metadata.html"
24
30
  And I should see "<p>Whatever: foo.bar</p>" in "_site/methods/configuration.html"
25
31
 
26
32
  Scenario: Rendered document in a layout
27
33
  Given I have an "index.html" page that contains "Collections: {{ site.collections }}"
28
34
  And I have a default layout that contains "<div class='title'>Tom Preston-Werner</div> {{content}}"
29
35
  And I have fixture collections
30
- And I have a configuration file with:
31
- | key | value |
32
- | collections | ['methods'] |
33
- | render | ['methods'] |
34
- When I run jekyll
36
+ And I have a "_config.yml" file with content:
37
+ """
38
+ collections:
39
+ methods:
40
+ output: true
41
+ foo: bar
42
+ """
43
+ When I run jekyll build
35
44
  Then the _site directory should exist
36
- And I should see "Collections: methods" in "_site/index.html"
45
+ And I should see "Collections: {\"methods" in "_site/index.html"
37
46
  And I should see "<p>Run your generators! default</p>" in "_site/methods/site/generate.html"
38
- And I should see "<div class='title'>Tom Preston-Werner</div>" in "_site/methods/site/generate.html"
47
+ And I should see "<div class='title'>Tom Preston-Werner</div>" in "_site/methods/site/generate.html"
48
+
49
+ Scenario: Collections specified as an array
50
+ Given I have an "index.html" page that contains "Collections: {% for method in site.methods %}{{ method.relative_path }} {% endfor %}"
51
+ And I have fixture collections
52
+ And I have a "_config.yml" file with content:
53
+ """
54
+ collections:
55
+ - methods
56
+ """
57
+ When I run jekyll build
58
+ Then the _site directory should exist
59
+ And I should see "Collections: _methods/configuration.md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html"
60
+
61
+ Scenario: Collections specified as an hash
62
+ Given I have an "index.html" page that contains "Collections: {% for method in site.methods %}{{ method.relative_path }} {% endfor %}"
63
+ And I have fixture collections
64
+ And I have a "_config.yml" file with content:
65
+ """
66
+ collections:
67
+ methods:
68
+ baz: bin
69
+ """
70
+ When I run jekyll build
71
+ Then the _site directory should exist
72
+ And I should see "Collections: _methods/configuration.md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html"
@@ -5,14 +5,14 @@ Feature: Create sites
5
5
 
6
6
  Scenario: Blank site
7
7
  Given I do not have a "test_blank" directory
8
- When I call jekyll new with test_blank --blank
8
+ When I run jekyll new test_blank --blank
9
9
  Then the test_blank/_layouts directory should exist
10
10
  And the test_blank/_posts directory should exist
11
11
  And the "test_blank/index.html" file should exist
12
12
 
13
13
  Scenario: Basic site
14
14
  Given I have an "index.html" file that contains "Basic Site"
15
- When I run jekyll
15
+ When I run jekyll build
16
16
  Then the _site directory should exist
17
17
  And I should see "Basic Site" in "_site/index.html"
18
18
 
@@ -21,7 +21,7 @@ Feature: Create sites
21
21
  And I have the following post:
22
22
  | title | date | content |
23
23
  | Hackers | 2009-03-27 | My First Exploit |
24
- When I run jekyll
24
+ When I run jekyll build
25
25
  Then the _site directory should exist
26
26
  And I should see "My First Exploit" in "_site/2009/03/27/hackers.html"
27
27
 
@@ -29,7 +29,7 @@ Feature: Create sites
29
29
  Given I have a _layouts directory
30
30
  And I have an "index.html" page with layout "default" that contains "Basic Site with Layout"
31
31
  And I have a default layout that contains "Page Layout: {{ content }}"
32
- When I run jekyll
32
+ When I run jekyll build
33
33
  Then the _site directory should exist
34
34
  And I should see "Page Layout: Basic Site with Layout" in "_site/index.html"
35
35
 
@@ -40,7 +40,7 @@ Feature: Create sites
40
40
  | title | date | layout | content |
41
41
  | Wargames | 2009-03-27 | default | The only winning move is not to play. |
42
42
  And I have a default layout that contains "Post Layout: {{ content }}"
43
- When I run jekyll
43
+ When I run jekyll build
44
44
  Then the _site directory should exist
45
45
  And I should see "Post Layout: <p>The only winning move is not to play.</p>" in "_site/2009/03/27/wargames.html"
46
46
 
@@ -51,7 +51,7 @@ Feature: Create sites
51
51
  | title | date | layout | content |
52
52
  | Wargames | 2009-03-27 | post/simple | The only winning move is not to play. |
53
53
  And I have a post/simple layout that contains "Post Layout: {{ content }}"
54
- When I run jekyll
54
+ When I run jekyll build
55
55
  Then the _site directory should exist
56
56
  And I should see "Post Layout: <p>The only winning move is not to play.</p>" in "_site/2009/03/27/wargames.html"
57
57
 
@@ -74,7 +74,7 @@ Feature: Create sites
74
74
  | title | date | layout | content |
75
75
  | entry3 | 2009-05-27 | post | content for entry3. |
76
76
  | entry4 | 2009-06-27 | post | content for entry4. |
77
- When I run jekyll
77
+ When I run jekyll build
78
78
  Then the _site directory should exist
79
79
  And I should see "Page : Site contains 2 pages and 4 posts" in "_site/index.html"
80
80
  And I should see "No replacement \{\{ site.posts.size \}\}" in "_site/about.html"
@@ -89,7 +89,7 @@ Feature: Create sites
89
89
  Given I have a _includes directory
90
90
  And I have an "index.html" page that contains "Basic Site with include tag: {% include about.textile %}"
91
91
  And I have an "_includes/about.textile" file that contains "Generated by Jekyll"
92
- When I run jekyll
92
+ When I run jekyll build
93
93
  Then the _site directory should exist
94
94
  And I should see "Basic Site with include tag: Generated by Jekyll" in "_site/index.html"
95
95
 
@@ -98,7 +98,7 @@ Feature: Create sites
98
98
  And I have an "_includes/about.textile" file that contains "Generated by Jekyll"
99
99
  And I have an info directory
100
100
  And I have an "info/index.html" page that contains "Basic Site with subdir include tag: {% include about.textile %}"
101
- When I run jekyll
101
+ When I run jekyll build
102
102
  Then the _site directory should exist
103
103
  And I should see "Basic Site with subdir include tag: Generated by Jekyll" in "_site/info/index.html"
104
104
 
@@ -107,7 +107,7 @@ Feature: Create sites
107
107
  And I have an "_includes/about.textile" file that contains "Generated by {% include jekyll.textile %}"
108
108
  And I have an "_includes/jekyll.textile" file that contains "Jekyll"
109
109
  And I have an "index.html" page that contains "Basic Site with include tag: {% include about.textile %}"
110
- When I run jekyll
110
+ When I run jekyll build
111
111
  Then the _site directory should exist
112
112
  And I should see "Basic Site with include tag: Generated by Jekyll" in "_site/index.html"
113
113
 
@@ -119,24 +119,24 @@ Feature: Create sites
119
119
  | title | date | layout | content |
120
120
  | entry1 | 2007-12-31 | post | content for entry1. |
121
121
  | entry2 | 2020-01-31 | post | content for entry2. |
122
- When I run jekyll
122
+ When I run jekyll build
123
123
  Then the _site directory should exist
124
124
  And I should see "URL: /2020/01/31/entry2/" in "_site/index.html"
125
125
 
126
126
  Scenario: Basic site with whitelisted dotfile
127
127
  Given I have an ".htaccess" file that contains "SomeDirective"
128
- When I run jekyll
128
+ When I run jekyll build
129
129
  Then the _site directory should exist
130
130
  And I should see "SomeDirective" in "_site/.htaccess"
131
131
 
132
132
  Scenario: File was replaced by a directory
133
133
  Given I have a "test" file that contains "some stuff"
134
- When I run jekyll
134
+ When I run jekyll build
135
135
  Then the _site directory should exist
136
136
  When I delete the file "test"
137
137
  Given I have a test directory
138
138
  And I have a "test/index.html" file that contains "some other stuff"
139
- When I run jekyll
139
+ When I run jekyll build
140
140
  Then the _site/test directory should exist
141
141
  And I should see "some other stuff" in "_site/test/index.html"
142
142
 
@@ -145,13 +145,13 @@ Feature: Create sites
145
145
  And I have a "public.html" page with published "true" that contains "Explicitly published page"
146
146
  And I have a "secret.html" page with published "false" that contains "Unpublished page"
147
147
 
148
- When I run jekyll
148
+ When I run jekyll build
149
149
  Then the _site directory should exist
150
150
  And the "_site/index.html" file should exist
151
151
  And the "_site/public.html" file should exist
152
152
  But the "_site/secret.html" file should not exist
153
153
 
154
- When I run jekyll with "--unpublished"
154
+ When I run jekyll build --unpublished
155
155
  Then the _site directory should exist
156
156
  And the "_site/index.html" file should exist
157
157
  And the "_site/public.html" file should exist
@@ -13,7 +13,7 @@ Feature: Data
13
13
  price: 2.5
14
14
  """
15
15
  And I have an "index.html" page that contains "{% for product in site.data.products %}{{product.name}}{% endfor %}"
16
- When I run jekyll
16
+ When I run jekyll build
17
17
  Then the "_site/index.html" file should exist
18
18
  And I should see "sugar" in "_site/index.html"
19
19
  And I should see "salt" in "_site/index.html"
@@ -28,7 +28,7 @@ Feature: Data
28
28
  age: 34
29
29
  """
30
30
  And I have an "index.html" page that contains "{% for member in site.data.members %}{{member.name}}{% endfor %}"
31
- When I run jekyll
31
+ When I run jekyll build
32
32
  Then the "_site/index.html" file should exist
33
33
  And I should see "Jack" in "_site/index.html"
34
34
  And I should see "Leon" in "_site/index.html"
@@ -43,7 +43,7 @@ Feature: Data
43
43
  age: 34
44
44
  """
45
45
  And I have an "index.html" page that contains "{% for member in site.data.team_members %}{{member.name}}{% endfor %}"
46
- When I run jekyll
46
+ When I run jekyll build
47
47
  Then the "_site/index.html" file should exist
48
48
  And I should see "Jack" in "_site/index.html"
49
49
  And I should see "Leon" in "_site/index.html"
@@ -58,7 +58,7 @@ Feature: Data
58
58
  age: 34
59
59
  """
60
60
  And I have an "index.html" page that contains "{% for member in site.data %}{{member.name}}{% endfor %}"
61
- When I run jekyll
61
+ When I run jekyll build
62
62
  Then the "_site/index.html" file should exist
63
63
  And I should see "Jack" in "_site/index.html"
64
64
  And I should see "Leon" in "_site/index.html"
@@ -9,7 +9,7 @@ Feature: Draft Posts
9
9
  And I have the following draft:
10
10
  | title | date | layout | content |
11
11
  | Recipe | 2009-03-27 | default | Not baked yet. |
12
- When I run jekyll with drafts
12
+ When I run jekyll build --drafts
13
13
  Then the _site directory should exist
14
14
  And I should see "Not baked yet." in "_site/recipe.html"
15
15
 
@@ -20,7 +20,7 @@ Feature: Draft Posts
20
20
  And I have the following draft:
21
21
  | title | date | layout | content |
22
22
  | Recipe | 2009-03-27 | default | Not baked yet. |
23
- When I run jekyll
23
+ When I run jekyll build
24
24
  Then the _site directory should exist
25
25
  And the "_site/recipe.html" file should not exist
26
26
 
@@ -31,7 +31,7 @@ Feature: Draft Posts
31
31
  And I have the following draft:
32
32
  | title | date | layout | published | content |
33
33
  | Recipe | 2009-03-27 | default | false | Not baked yet. |
34
- When I run jekyll with drafts
34
+ When I run jekyll build --drafts
35
35
  Then the _site directory should exist
36
36
  And the "_site/recipe.html" file should not exist
37
37
 
@@ -41,6 +41,6 @@ Feature: Draft Posts
41
41
  And I have the following draft:
42
42
  | title | date | layout | content |
43
43
  | Recipe | 2009-03-27 | simple | Post path: {{ page.path }} |
44
- When I run jekyll with drafts
44
+ When I run jekyll build --drafts
45
45
  Then the _site directory should exist
46
46
  And I should see "Post path: _drafts/recipe.textile" in "_site/recipe.html"
@@ -10,7 +10,7 @@ Feature: Embed filters
10
10
  | title | date | layout | content |
11
11
  | Star Wars | 2009-03-27 | default | These aren't the droids you're looking for. |
12
12
  And I have a default layout that contains "{{ site.time | date_to_xmlschema }}"
13
- When I run jekyll
13
+ When I run jekyll build
14
14
  Then the _site directory should exist
15
15
  And I should see today's date in "_site/2009/03/27/star-wars.html"
16
16
 
@@ -23,7 +23,7 @@ Feature: Embed filters
23
23
 
24
24
 
25
25
  And I have a default layout that contains "{{ page.title | xml_escape }}"
26
- When I run jekyll
26
+ When I run jekyll build
27
27
  Then the _site directory should exist
28
28
  And I should see "Star &amp; Wars" in "_site/2009/03/27/star-wars.html"
29
29
 
@@ -34,7 +34,7 @@ Feature: Embed filters
34
34
  | title | date | layout | content |
35
35
  | Star Wars | 2009-03-27 | default | These aren't the droids you're looking for. |
36
36
  And I have a default layout that contains "{{ content | xml_escape }}"
37
- When I run jekyll
37
+ When I run jekyll build
38
38
  Then the _site directory should exist
39
39
  And I should see "7" in "_site/2009/03/27/star-wars.html"
40
40
 
@@ -45,7 +45,7 @@ Feature: Embed filters
45
45
  | title | date | layout | tags | content |
46
46
  | Star Wars | 2009-03-27 | default | [scifi, movies, force] | These aren't the droids you're looking for. |
47
47
  And I have a default layout that contains "{{ page.tags | array_to_sentence_string }}"
48
- When I run jekyll
48
+ When I run jekyll build
49
49
  Then the _site directory should exist
50
50
  And I should see "scifi, movies, and force" in "_site/2009/03/27/star-wars.html"
51
51
 
@@ -56,7 +56,7 @@ Feature: Embed filters
56
56
  | title | date | layout | content |
57
57
  | Star Wars | 2009-03-27 | default | These aren't the droids you're looking for. |
58
58
  And I have a default layout that contains "By {{ '_Obi-wan_' | textilize }}"
59
- When I run jekyll
59
+ When I run jekyll build
60
60
  Then the _site directory should exist
61
61
  And I should see "By <p><em>Obi-wan</em></p>" in "_site/2009/03/27/star-wars.html"
62
62
 
@@ -69,7 +69,7 @@ Feature: Embed filters
69
69
  | title | layout | value | content |
70
70
  | Page-2 | default | 6 | Something |
71
71
  And I have a default layout that contains "{{ site.pages | sort:'value' | map:'title' | join:', ' }}"
72
- When I run jekyll
72
+ When I run jekyll build
73
73
  Then the _site directory should exist
74
74
  And I should see exactly "Page-2, Page-1" in "_site/page-1.html"
75
75
  And I should see exactly "Page-2, Page-1" in "_site/page-2.html"
@@ -0,0 +1,79 @@
1
+ Feature: frontmatter defaults
2
+ Scenario: Use default for frontmatter variables internally
3
+ Given I have a _layouts directory
4
+ And I have a pretty layout that contains "THIS IS THE LAYOUT: {{content}}"
5
+
6
+ And I have a _posts directory
7
+ And I have the following post:
8
+ | title | date | content |
9
+ | default layout | 2013-09-11 | just some post |
10
+ And I have an "index.html" page with title "some title" that contains "just some page"
11
+
12
+ And I have a configuration file with "defaults" set to "[{scope: {path: ""}, values: {layout: "pretty"}}]"
13
+
14
+ When I run jekyll build
15
+ Then the _site directory should exist
16
+ And I should see "THIS IS THE LAYOUT: <p>just some post</p>" in "_site/2013/09/11/default-layout.html"
17
+ And I should see "THIS IS THE LAYOUT: just some page" in "_site/index.html"
18
+
19
+ Scenario: Use default for frontmatter variables in Liquid
20
+ Given I have a _posts directory
21
+ And I have the following post:
22
+ | title | date | content |
23
+ | default data | 2013-09-11 | <p>{{page.custom}}</p><div>{{page.author}}</div> |
24
+ And I have an "index.html" page that contains "just {{page.custom}} by {{page.author}}"
25
+ And I have a configuration file with "defaults" set to "[{scope: {path: ""}, values: {custom: "some special data", author: "Ben"}}]"
26
+ When I run jekyll build
27
+ Then the _site directory should exist
28
+ And I should see "<p>some special data</p><div>Ben</div>" in "_site/2013/09/11/default-data.html"
29
+ And I should see "just some special data by Ben" in "_site/index.html"
30
+
31
+ Scenario: Override frontmatter defaults by path
32
+ Given I have a _layouts directory
33
+ And I have a root layout that contains "root: {{ content }}"
34
+ And I have a subfolder layout that contains "subfolder: {{ content }}"
35
+
36
+ And I have a _posts directory
37
+ And I have the following post:
38
+ | title | date | content |
39
+ | about | 2013-10-14 | info on {{page.description}} |
40
+ And I have a special/_posts directory
41
+ And I have the following post in "special":
42
+ | title | date | path | content |
43
+ | about | 2013-10-14 | local | info on {{page.description}} |
44
+
45
+ And I have an "index.html" page with title "overview" that contains "Overview for {{page.description}}"
46
+ And I have an "special/index.html" page with title "section overview" that contains "Overview for {{page.description}}"
47
+
48
+ 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"}}]"
49
+
50
+ When I run jekyll build
51
+ Then the _site directory should exist
52
+ And I should see "root: <p>info on the webpage</p>" in "_site/2013/10/14/about.html"
53
+ And I should see "subfolder: <p>info on the special section</p>" in "_site/special/2013/10/14/about.html"
54
+ And I should see "root: Overview for the webpage" in "_site/index.html"
55
+ And I should see "subfolder: Overview for the special section" in "_site/special/index.html"
56
+
57
+ Scenario: Override frontmatter defaults by type
58
+ Given I have a _posts directory
59
+ And I have the following post:
60
+ | title | date | content |
61
+ | this is a post | 2013-10-14 | blabla |
62
+ And I have an "index.html" page that contains "interesting stuff"
63
+ 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"}}]"
64
+ When I run jekyll build
65
+ Then I should see "blabla" in "_site/post.html"
66
+ And I should see "interesting stuff" in "_site/page.html"
67
+ But the "_site/perma.html" file should not exist
68
+
69
+ Scenario: Actual frontmatter overrides defaults
70
+ Given I have a _posts directory
71
+ And I have the following post:
72
+ | title | date | permalink | author | content |
73
+ | override | 2013-10-14 | /frontmatter.html | some guy | a blog by {{page.author}} |
74
+ And I have an "index.html" page with permalink "override.html" that contains "nothing"
75
+ And I have a configuration file with "defaults" set to "[{scope: {path: ""}, values: {permalink: "/perma.html", author: "Chris"}}]"
76
+ When I run jekyll build
77
+ Then I should see "a blog by some guy" in "_site/frontmatter.html"
78
+ And I should see "nothing" in "_site/override.html"
79
+ But the "_site/perma.html" file should not exist