jekyll 2.0.3 → 2.1.0

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 (107) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -2
  3. data/CONTRIBUTING.markdown +2 -2
  4. data/History.markdown +86 -0
  5. data/README.markdown +5 -30
  6. data/Rakefile +4 -9
  7. data/docs/jp/CONTRIBUTING.jp.markdown +2 -2
  8. data/docs/jp/README.jp.markdown +1 -2
  9. data/features/collections.feature +40 -3
  10. data/features/data.feature +41 -1
  11. data/features/frontmatter_defaults.feature +57 -0
  12. data/features/post_data.feature +12 -0
  13. data/features/rendering.feature +34 -0
  14. data/features/step_definitions/jekyll_steps.rb +5 -1
  15. data/features/support/env.rb +0 -3
  16. data/jekyll.gemspec +6 -5
  17. data/lib/jekyll.rb +18 -1
  18. data/lib/jekyll/cleaner.rb +22 -2
  19. data/lib/jekyll/collection.rb +9 -2
  20. data/lib/jekyll/command.rb +20 -10
  21. data/lib/jekyll/commands/build.rb +10 -47
  22. data/lib/jekyll/commands/serve.rb +1 -0
  23. data/lib/jekyll/configuration.rb +13 -1
  24. data/lib/jekyll/converters/markdown/redcarpet_parser.rb +9 -2
  25. data/lib/jekyll/convertible.rb +31 -2
  26. data/lib/jekyll/deprecator.rb +1 -1
  27. data/lib/jekyll/document.rb +21 -3
  28. data/lib/jekyll/excerpt.rb +1 -1
  29. data/lib/jekyll/filters.rb +16 -12
  30. data/lib/jekyll/frontmatter_defaults.rb +3 -3
  31. data/lib/jekyll/log_adapter.rb +102 -0
  32. data/lib/jekyll/post.rb +5 -5
  33. data/lib/jekyll/renderer.rb +9 -5
  34. data/lib/jekyll/site.rb +38 -18
  35. data/lib/jekyll/static_file.rb +1 -0
  36. data/lib/jekyll/stevenson.rb +54 -98
  37. data/lib/jekyll/tags/highlight.rb +13 -5
  38. data/lib/jekyll/url.rb +2 -2
  39. data/lib/jekyll/utils.rb +15 -7
  40. data/lib/jekyll/version.rb +1 -1
  41. data/lib/site_template/_config.yml +2 -0
  42. data/lib/site_template/_includes/footer.html +8 -8
  43. data/lib/site_template/_includes/header.html +1 -1
  44. data/lib/site_template/css/main.css +7 -2
  45. data/lib/site_template/feed.xml +10 -1
  46. data/site/_config.yml +1 -0
  47. data/site/_data/docs.yml +1 -0
  48. data/site/_includes/anchor_links.html +28 -23
  49. data/site/_includes/css/font-awesome.css +3 -3
  50. data/site/_includes/css/style.css +4 -0
  51. data/site/_includes/news_contents.html +11 -1
  52. data/site/_includes/top.html +0 -1
  53. data/site/_layouts/default.html +1 -0
  54. data/site/_posts/2013-07-25-jekyll-1-0-4-released.markdown +1 -1
  55. data/site/_posts/2013-07-25-jekyll-1-1-2-released.markdown +1 -1
  56. data/site/_posts/2014-06-04-jekyll-stickers-1-dollar-stickermule.markdown +19 -0
  57. data/site/_posts/2014-06-28-jekyll-turns-21-i-mean-2-1-0.markdown +27 -0
  58. data/site/docs/collections.md +59 -1
  59. data/site/docs/configuration.md +91 -21
  60. data/site/docs/continuous-integration.md +177 -0
  61. data/site/docs/contributing.md +2 -2
  62. data/site/docs/datafiles.md +47 -3
  63. data/site/docs/deployment-methods.md +3 -3
  64. data/site/docs/extras.md +3 -5
  65. data/site/docs/history.md +86 -0
  66. data/site/docs/installation.md +3 -1
  67. data/site/docs/pagination.md +2 -1
  68. data/site/docs/permalinks.md +4 -4
  69. data/site/docs/plugins.md +6 -0
  70. data/site/docs/quickstart.md +0 -6
  71. data/site/docs/resources.md +1 -1
  72. data/site/docs/templates.md +1 -1
  73. data/site/docs/troubleshooting.md +1 -1
  74. data/site/docs/windows.md +2 -2
  75. data/site/fonts/FontAwesome.otf +0 -0
  76. data/site/fonts/fontawesome-webfont.eot +0 -0
  77. data/site/fonts/fontawesome-webfont.svg +469 -379
  78. data/site/fonts/fontawesome-webfont.ttf +0 -0
  79. data/site/fonts/fontawesome-webfont.woff +0 -0
  80. data/site/img/jekyll-sticker.jpg +0 -0
  81. data/test/helper.rb +0 -3
  82. data/test/source/_data/categories/dairy.yaml +6 -0
  83. data/test/source/_data/members.json +12 -0
  84. data/test/source/_methods/site/initialize.md +1 -2
  85. data/test/source/_posts/2009-01-27-no-category.textile +6 -0
  86. data/test/source/_slides/example-slide-1.html +4 -0
  87. data/test/source/_slides/example-slide-2.html +7 -0
  88. data/test/source/_with.dots/all.dots/2.4.0.md +5 -0
  89. data/test/source/_with.dots/file.with.dots.md +0 -0
  90. data/test/source/environment.html +5 -0
  91. data/test/test_cleaner.rb +77 -0
  92. data/test/test_collections.rb +52 -3
  93. data/test/test_command.rb +25 -28
  94. data/test/test_configuration.rb +10 -1
  95. data/test/test_document.rb +123 -0
  96. data/test/test_excerpt.rb +11 -0
  97. data/test/test_filters.rb +28 -2
  98. data/test/test_generated_site.rb +1 -1
  99. data/test/test_log_adapter.rb +59 -0
  100. data/test/test_post.rb +77 -0
  101. data/test/test_site.rb +51 -0
  102. data/test/test_tags.rb +11 -114
  103. data/test/test_utils.rb +2 -2
  104. metadata +76 -39
  105. data/lib/jekyll/generators/pagination.rb +0 -217
  106. data/lib/jekyll/tags/gist.rb +0 -47
  107. data/test/test_pager.rb +0 -118
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1ed5e240dbbd58c004f13b3c6337dca1c5a757f9
4
- data.tar.gz: b69c82422c9be169e7a4dc4626268092a80f44ad
3
+ metadata.gz: 8630d257c463ffcf3ee92aad938ebd5975ff8c81
4
+ data.tar.gz: 9a07f6df12e2bf48b25f987c43d33834a03f49fc
5
5
  SHA512:
6
- metadata.gz: 950f2add8c0bd180e04073b7b1b41e13cb887a38e7476c2eaf69f57434ec532ca2a642a68649d5db8f76f5b13908c3b8a3d6bb16ce7ee618076d707ef2b22439
7
- data.tar.gz: ecda77f22316674ca4baec5d6342587ad0cb5e4c7344acc58efce3a8429d3406569ce54c26b511545a4472f957137e0b79bb276ed6ca1f4a8fdbc11b2e7f5d57
6
+ metadata.gz: 6ea2a31ab0006db1f258c101679ab98c9c401eb7738d18dec74f72c745f231e8fede3dc46a7e4582870b0210d75b407a669203416980fe3316e3ceec9bf0c470
7
+ data.tar.gz: d081db50caabc6c047916587691e5bac090967327f6508943c754d918f4ae0b9327e53a6b716147c5654e592f9c42bde75065808b5c8009e6b2749335b55976b
@@ -4,8 +4,8 @@ install:
4
4
  - script/rebund download
5
5
  - travis_retry bundle install --path vendor/bundle
6
6
  rvm:
7
- - 2.1.1
8
- - 2.0.0
7
+ - 2.1
8
+ - 2.0
9
9
  - 1.9.3
10
10
  script: script/cibuild
11
11
  after_script:
@@ -4,10 +4,10 @@ Contribute
4
4
  So you've got an awesome idea to throw into Jekyll. Great! Please keep the
5
5
  following in mind:
6
6
 
7
- * **Contributions will not be accepted without tests.**
7
+ * **Contributions will not be accepted without tests or necessary documentation updates.**
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
- [Shoulda](http://github.com/thoughtbot/shoulda/tree/master) and
10
+ [Shoulda](https://github.com/thoughtbot/shoulda/tree/master) and
11
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
@@ -10,6 +10,92 @@
10
10
 
11
11
  ### Site Enhancements
12
12
 
13
+ ## 2.1.0 / 2014-06-28
14
+
15
+ ### Minor Enhancements
16
+
17
+ * Bump to the latest Liquid version, 2.6.1 (#2495)
18
+ * Add support for JSON files in the `_data` directory (#2369)
19
+ * Allow subclasses to override `EXCERPT_ATTRIBUTES_FOR_LIQUID` (#2408)
20
+ * Add `Jekyll.env` and `jekyll.environment` (the Liquid var) (#2417)
21
+ * Use `_config.yaml` or `_config.yml` (`.yml` takes precedence) (#2406)
22
+ * Override collection url template (#2418)
23
+ * Allow subdirectories in `_data` (#2395)
24
+ * Extract Pagination Generator into gem: `jekyll-paginate` (#2455)
25
+ * Utilize `date_to_rfc822` filter in site template (#2437)
26
+ * Add categories, last build datetime, and generator to site template
27
+ feed (#2438)
28
+ * Configurable, replaceable Logger-compliant logger (#2444)
29
+ * Extract `gist` tag into a separate gem (#2469)
30
+ * Add `collection` attribute to `Document#to_liquid` to access the
31
+ document's collection label. (#2436)
32
+ * Upgrade listen to `2.7.6 <= x < 3.0.0` (#2492)
33
+ * Allow configuration of different Twitter and GitHub usernames in site template (#2485)
34
+ * Bump Pygments to v0.6.0 (#2504)
35
+ * Front-matter defaults for documents in collections (#2419)
36
+ * Include files with a url which ends in `/` in the `site.html_pages` list (#2524)
37
+ * Make `highlight` tag use `language-` prefix in CSS class (#2511)
38
+ * Lookup item property via `item#to_liquid` before `#data` or `#[]` in filters (#2493)
39
+ * Skip initial build of site on serve with flag (#2477)
40
+ * Add support for `hl_lines` in `highlight` tag (#2532)
41
+ * Spike out `--watch` flag into a separate gem (#2550)
42
+
43
+ ### Bug Fixes
44
+
45
+ * Liquid `sort` filter should sort even if one of the values is `nil` (#2345)
46
+ * Remove padding on `pre code` in the site template CSS (#2383)
47
+ * Set `log_level` earlier to silence info level configuration output (#2393)
48
+ * Only list pages which have `title` in site template (#2411)
49
+ * Accept `Numeric` values for dates, not `Number` values (#2377)
50
+ * Prevent code from overflowing container in site template (#2429)
51
+ * Encode URLs in UTF-8 when escaping and unescaping (#2420)
52
+ * No Layouts or Liquid for Asset Files (#2431)
53
+ * Allow front-matter defaults to set post categories (#2373)
54
+ * Fix command in subcommand deprecation warning (#2457)
55
+ * Keep all parent directories of files/dirs in `keep_files` (#2458)
56
+ * When using RedCarpet and Rouge without Rouge installed, fixed erroneous
57
+ error which stated that redcarpet was missing, not rouge. (#2464)
58
+ * Ignore *all* directories and files that merit it on auto-generation (#2459)
59
+ * Before copying file, explicitly remove the old one (#2535)
60
+ * Merge file system categories with categories from YAML. (#2531)
61
+ * Deep merge front matter defaults (#2490)
62
+ * Ensure exclude and include arrays are arrays of strings (#2542)
63
+ * Allow collections to have dots in their filenames (#2552)
64
+ * Collections shouldn't try to read in directories as files (#2552)
65
+ * Be quiet very quickly. (#2520)
66
+
67
+ ### Development Fixes
68
+
69
+ * Test Ruby 2.1.2 instead of 2.1.1 (#2374)
70
+ * Add test for sorting UTF-8 characters (#2384)
71
+ * Use `https` for GitHub links in documentation (#2470)
72
+ * Remove coverage reporting with Coveralls (#2494)
73
+ * Fix a bit of missing TomDoc to `Jekyll::Commands::Build#build` (#2554)
74
+
75
+ ### Site Enhancements
76
+
77
+ * Set `timezone` to `America/Los_Angeles` (#2394)
78
+ * Improve JavaScript in `anchor_links.html` (#2368)
79
+ * Remove note on Quickstart page about default markdown converter (#2387)
80
+ * Remove broken link in extras.md to a Maruku fork (#2401)
81
+ * Update Font Awesome to v4.1.0. (#2410)
82
+ * Fix broken link on Installation page to Templates page (#2421)
83
+ * Prevent table from extending parent width in permalink style table (#2424)
84
+ * Add collections to info about pagination support (#2389)
85
+ * Add `jekyll_github_sample` plugin to list of third-party plugins (#2463)
86
+ * Clarify documentation around front-matter defaults and add details
87
+ about defaults for collections. (#2439)
88
+ * Add Jekyll Project Version Tag to list of third-party plugins (#2468)
89
+ * Use `https` for GitHub links across whole site (#2470)
90
+ * Add StickerMule + Jekyll post (#2476)
91
+ * Add Jekyll Asset Pipeline Reborn to list of third-party plugins (#2479)
92
+ * Add link to jekyll-compress-html to list of third-party plugins (#2514)
93
+ * Add Piwigo Gallery to list of third-party plugins (#2526)
94
+ * Set `show_drafts` to `false` in default configuration listing (#2536)
95
+ * Provide an updated link for Windows installation instructions (#2544)
96
+ * Remove `url` from configuration docs (#2547)
97
+ * Documentation for Continuous Integration for your Jekyll Site (#2432)
98
+
13
99
  ## 2.0.3 / 2014-05-08
14
100
 
15
101
  ### Bug Fixes
@@ -1,11 +1,9 @@
1
1
  # [Jekyll](http://jekyllrb.com/)
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/jekyll.svg)](http://badge.fury.io/rb/jekyll)
4
-
3
+ [![Gem Version](https://badge.fury.io/rb/jekyll.svg)](https://rubygems.org/gems/jekyll)
5
4
  [![Build Status](https://secure.travis-ci.org/jekyll/jekyll.svg?branch=master)](https://travis-ci.org/jekyll/jekyll)
6
- [![Code Climate](https://codeclimate.com/github/jekyll/jekyll.png)](https://codeclimate.com/github/jekyll/jekyll)
5
+ [![Code Climate](http://img.shields.io/codeclimate/github/jekyll/jekyll.svg)](https://codeclimate.com/github/jekyll/jekyll)
7
6
  [![Dependency Status](https://gemnasium.com/jekyll/jekyll.svg)](https://gemnasium.com/jekyll/jekyll)
8
- [![Coverage Status](https://coveralls.io/repos/jekyll/jekyll/badge.png)](https://coveralls.io/r/jekyll/jekyll)
9
7
 
10
8
  By Tom Preston-Werner, Nick Quaranto, and many [awesome contributors](https://github.com/jekyll/jekyll/graphs/contributors)!
11
9
 
@@ -19,42 +17,19 @@ Jekyll does what you tell it to do — no more, no less. It doesn't try to outs
19
17
 
20
18
  * [Install](http://jekyllrb.com/docs/installation/) the gem
21
19
  * Read up about its [Usage](http://jekyllrb.com/docs/usage/) and [Configuration](http://jekyllrb.com/docs/configuration/)
22
- * Take a gander at some existing [Sites](http://wiki.github.com/jekyll/jekyll/sites)
20
+ * Take a gander at some existing [Sites](https://wiki.github.com/jekyll/jekyll/sites)
23
21
  * Fork and [Contribute](http://jekyllrb.com/docs/contributing/) your own modifications
24
- * Have questions? Check out `#jekyll` on irc.freenode.net.
22
+ * Have questions? Check out [`#jekyll` on irc.freenode.net](https://botbot.me/freenode/jekyll/).
25
23
 
26
24
  ## Diving In
27
25
 
28
- * [Migrate](http://jekyllrb.com/docs/migrations/) from your previous system
26
+ * [Migrate](http://import.jekyllrb.com/docs/home/) from your previous system
29
27
  * Learn how the [YAML Front Matter](http://jekyllrb.com/docs/frontmatter/) works
30
28
  * Put information on your site with [Variables](http://jekyllrb.com/docs/variables/)
31
29
  * Customize the [Permalinks](http://jekyllrb.com/docs/permalinks/) your posts are generated with
32
30
  * Use the built-in [Liquid Extensions](http://jekyllrb.com/docs/templates/) to make your life easier
33
31
  * Use custom [Plugins](http://jekyllrb.com/docs/plugins/) to generate content specific to your site
34
32
 
35
- ## Runtime Dependencies
36
-
37
- * Commander: Command-line interface constructor (Ruby)
38
- * Colorator: Colorizes command line output (Ruby)
39
- * Classifier: Generating related posts (Ruby)
40
- * Directory Watcher: Auto-regeneration of sites (Ruby)
41
- * Kramdown: Default Markdown engine (Ruby)
42
- * Liquid: Templating system (Ruby)
43
- * Pygments.rb: Syntax highlighting (Ruby/Python)
44
- * RedCarpet: Markdown engine (Ruby)
45
- * Safe YAML: YAML Parser built for security (Ruby)
46
-
47
- ## Developer Dependencies
48
-
49
- * Launchy: Cross-platform file launcher (Ruby)
50
- * Maruku: Markdown-superset interpreter (Ruby)
51
- * RDiscount: Discount Markdown Processor (Ruby)
52
- * RedCloth: Textile support (Ruby)
53
- * RedGreen: Nicer test output (Ruby)
54
- * RR: Mocking (Ruby)
55
- * Shoulda: Test framework (Ruby)
56
- * SimpleCov: Coverage framework (Ruby)
57
-
58
33
  ## License
59
34
 
60
35
  See [LICENSE](https://github.com/jekyll/jekyll/blob/master/LICENSE).
data/Rakefile CHANGED
@@ -14,7 +14,7 @@ require 'jekyll/version'
14
14
  #############################################################################
15
15
 
16
16
  def name
17
- @name ||= Dir['*.gemspec'].first.split('.').first
17
+ @name ||= File.basename(Dir['*.gemspec'].first, ".*")
18
18
  end
19
19
 
20
20
  def version
@@ -68,14 +68,7 @@ end
68
68
  #
69
69
  #############################################################################
70
70
 
71
- if ENV["TRAVIS"] == "true"
72
- require 'coveralls/rake/task'
73
- Coveralls::RakeTask.new
74
-
75
- task :default => [:test, :features, 'coveralls:push']
76
- else
77
- task :default => [:test, :features]
78
- end
71
+ task :default => [:test, :features]
79
72
 
80
73
  require 'rake/testtask'
81
74
  Rake::TestTask.new(:test) do |test|
@@ -235,6 +228,7 @@ end
235
228
  #
236
229
  #############################################################################
237
230
 
231
+ desc "Release #{name} v#{version}"
238
232
  task :release => :build do
239
233
  unless `git branch` =~ /^\* master$/
240
234
  puts "You must be on the master branch to release!"
@@ -247,6 +241,7 @@ task :release => :build do
247
241
  sh "gem push pkg/#{name}-#{version}.gem"
248
242
  end
249
243
 
244
+ desc "Build #{name} v#{version} into pkg/"
250
245
  task :build do
251
246
  mkdir_p "pkg"
252
247
  sh "gem build #{gemspec_file}"
@@ -7,8 +7,8 @@
7
7
  * **テストなしではコントリビュートはできません。**
8
8
  * もし、既存の機能への小さな修正やパッチを作成したなら、シンプルなテストを行います。
9
9
  現在のテストスイートの範囲にとどまり、そして
10
- [Shoulda](http://github.com/thoughtbot/shoulda/tree/master) や
11
- [RR](http://github.com/btakita/rr/tree/master) を使用してください。
10
+ [Shoulda](https://github.com/thoughtbot/shoulda/tree/master) や
11
+ [RR](https://github.com/btakita/rr/tree/master) を使用してください。
12
12
  * もし、それが新しい機能の場合は、必ず新しい
13
13
  [Cucumber](https://github.com/cucumber/cucumber/) の機能を作成し、
14
14
  必要に応じて手順を再利用します。
@@ -5,7 +5,6 @@
5
5
  [![Build Status](https://secure.travis-ci.org/jekyll/jekyll.png?branch=master)](https://travis-ci.org/jekyll/jekyll)
6
6
  [![Code Climate](https://codeclimate.com/github/jekyll/jekyll.png)](https://codeclimate.com/github/jekyll/jekyll)
7
7
  [![Dependency Status](https://gemnasium.com/jekyll/jekyll.png)](https://gemnasium.com/jekyll/jekyll)
8
- [![Coverage Status](https://coveralls.io/repos/jekyll/jekyll/badge.png)](https://coveralls.io/r/jekyll/jekyll)
9
8
 
10
9
  Tom Preston-Werner, Nick Quaranto や多くの[素晴らしいコントリビュータ](https://github.com/jekyll/jekyll/graphs/contributors)によって作成されています!
11
10
 
@@ -28,7 +27,7 @@ Jekyll あなたがするように伝えたことをします ― それ以上
28
27
 
29
28
  * gem を[インストール](http://jekyllrb.com/docs/installation/)します
30
29
  * [使用方法](http://jekyllrb.com/docs/usage/) と [設定方法](http://jekyllrb.com/docs/configuration/) を読みます
31
- * 既存の [Jekyll で作られたサイト](http://wiki.github.com/jekyll/jekyll/sites) をチラッと見ます
30
+ * 既存の [Jekyll で作られたサイト](https://wiki.github.com/jekyll/jekyll/sites) をチラッと見ます
32
31
  * Fork し、あなたの変更を [コントリビュート](http://jekyllrb.com/docs/contributing/) します
33
32
  * 質問があったら? irc.freenode.net の `#jekyll` チャンネルをチェックしてください
34
33
 
@@ -9,7 +9,7 @@ Feature: Collections
9
9
  And I have a configuration file with "collections" set to "['methods']"
10
10
  When I run jekyll build
11
11
  Then the _site directory should exist
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"
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>Page without title.</p>\n<p>Run your generators! default</p>" in "_site/index.html"
13
13
  And the "_site/methods/configuration.html" file should not exist
14
14
 
15
15
  Scenario: Rendered collection
@@ -29,6 +29,20 @@ Feature: Collections
29
29
  And I should see "Methods metadata: bar" in "_site/collection_metadata.html"
30
30
  And I should see "<p>Whatever: foo.bar</p>" in "_site/methods/configuration.html"
31
31
 
32
+ Scenario: Rendered collection at a custom URL
33
+ Given I have an "index.html" page that contains "Collections: {{ site.collections }}"
34
+ And I have fixture collections
35
+ And I have a "_config.yml" file with content:
36
+ """
37
+ collections:
38
+ methods:
39
+ output: true
40
+ permalink: /:collection/:path/
41
+ """
42
+ When I run jekyll build
43
+ Then the _site directory should exist
44
+ And I should see "<p>Whatever: foo.bar</p>" in "_site/methods/configuration/index.html"
45
+
32
46
  Scenario: Rendered document in a layout
33
47
  Given I have an "index.html" page that contains "Collections: {{ site.collections }}"
34
48
  And I have a default layout that contains "<div class='title'>Tom Preston-Werner</div> {{content}}"
@@ -64,8 +78,7 @@ Feature: Collections
64
78
  And I have a "_config.yml" file with content:
65
79
  """
66
80
  collections:
67
- methods:
68
- baz: bin
81
+ - methods
69
82
  """
70
83
  When I run jekyll build
71
84
  Then the _site directory should exist
@@ -106,3 +119,27 @@ Feature: Collections
106
119
  When I run jekyll build
107
120
  Then the _site directory should exist
108
121
  And I should see "Item count: 1" in "_site/index.html"
122
+
123
+ Scenario: Sort by title
124
+ Given I have an "index.html" page that contains "{% assign items = site.methods | sort: 'title' %}1. of {{ items.size }}: {{ items.first.output }}"
125
+ And I have fixture collections
126
+ And I have a "_config.yml" file with content:
127
+ """
128
+ collections:
129
+ - methods
130
+ """
131
+ When I run jekyll build
132
+ Then the _site directory should exist
133
+ And I should see "1. of 5: <p>Page without title.</p>" in "_site/index.html"
134
+
135
+ Scenario: Sort by relative_path
136
+ Given I have an "index.html" page that contains "Collections: {% assign methods = site.methods | sort: 'relative_path' %}{% for method in methods %}{{ method.title }}, {% endfor %}"
137
+ And I have fixture collections
138
+ And I have a "_config.yml" file with content:
139
+ """
140
+ collections:
141
+ - methods
142
+ """
143
+ When I run jekyll build
144
+ Then the _site directory should exist
145
+ And I should see "Collections: Jekyll.configuration, Jekyll.sanitized_path, Site#generate, , Site#generate," in "_site/index.html"
@@ -33,6 +33,18 @@ Feature: Data
33
33
  And I should see "Jack" in "_site/index.html"
34
34
  And I should see "Leon" in "_site/index.html"
35
35
 
36
+ Scenario: autoload *.json files in _data directory
37
+ Given I have a _data directory
38
+ And I have a "_data/members.json" file with content:
39
+ """
40
+ [{"name": "Jack", "age": 28},{"name": "Leon", "age": 34}]
41
+ """
42
+ And I have an "index.html" page that contains "{% for member in site.data.members %}{{member.name}}{% endfor %}"
43
+ When I run jekyll build
44
+ Then the "_site/index.html" file should exist
45
+ And I should see "Jack" in "_site/index.html"
46
+ And I should see "Leon" in "_site/index.html"
47
+
36
48
  Scenario: autoload *.yml files in _data directory with space in file name
37
49
  Given I have a _data directory
38
50
  And I have a "_data/team members.yml" file with content:
@@ -48,6 +60,35 @@ Feature: Data
48
60
  And I should see "Jack" in "_site/index.html"
49
61
  And I should see "Leon" in "_site/index.html"
50
62
 
63
+ Scenario: autoload *.yaml files in subdirectories in _data directory
64
+ Given I have a _data directory
65
+ And I have a _data/categories directory
66
+ And I have a "_data/categories/dairy.yaml" file with content:
67
+ """
68
+ name: Dairy Products
69
+ """
70
+ And I have an "index.html" page that contains "{{ site.data.categories.dairy.name }}"
71
+ When I run jekyll build
72
+ Then the "_site/index.html" file should exist
73
+ And I should see "Dairy Products" in "_site/index.html"
74
+
75
+ Scenario: folders should have precedence over files with the same name
76
+ Given I have a _data directory
77
+ And I have a _data/categories directory
78
+ And I have a "_data/categories/dairy.yaml" file with content:
79
+ """
80
+ name: Dairy Products
81
+ """
82
+ And I have a "_data/categories.yaml" file with content:
83
+ """
84
+ dairy:
85
+ name: Should not display this
86
+ """
87
+ And I have an "index.html" page that contains "{{ site.data.categories.dairy.name }}"
88
+ When I run jekyll build
89
+ Then the "_site/index.html" file should exist
90
+ And I should see "Dairy Products" in "_site/index.html"
91
+
51
92
  Scenario: should be backward compatible with site.data in _config.yml
52
93
  Given I have a "_config.yml" file with content:
53
94
  """
@@ -62,4 +103,3 @@ Feature: Data
62
103
  Then the "_site/index.html" file should exist
63
104
  And I should see "Jack" in "_site/index.html"
64
105
  And I should see "Leon" in "_site/index.html"
65
-
@@ -77,3 +77,60 @@ Feature: frontmatter defaults
77
77
  Then I should see "a blog by some guy" in "_site/frontmatter.html"
78
78
  And I should see "nothing" in "_site/override.html"
79
79
  But the "_site/perma.html" file should not exist
80
+
81
+ Scenario: Use frontmatter defaults in collections
82
+ Given I have a _slides directory
83
+ And I have a "index.html" file that contains "nothing"
84
+ And I have a "_slides/slide1.html" file with content:
85
+ """
86
+ Value: {{ page.myval }}
87
+ """
88
+ And I have a "_config.yml" file with content:
89
+ """
90
+ collections:
91
+ slides:
92
+ output: true
93
+ defaults:
94
+ -
95
+ scope:
96
+ path: ""
97
+ type: slides
98
+ values:
99
+ myval: "Test"
100
+ """
101
+ When I run jekyll build
102
+ Then the _site directory should exist
103
+ And I should see "Value: Test" in "_site/slides/slide1.html"
104
+
105
+ Scenario: Override frontmatter defaults inside a collection
106
+ Given I have a _slides directory
107
+ And I have a "index.html" file that contains "nothing"
108
+ And I have a "_slides/slide2.html" file with content:
109
+ """
110
+ ---
111
+ myval: Override
112
+ ---
113
+ Value: {{ page.myval }}
114
+ """
115
+ And I have a "_config.yml" file with content:
116
+ """
117
+ collections:
118
+ slides:
119
+ output: true
120
+ defaults:
121
+ -
122
+ scope:
123
+ path: ""
124
+ type: slides
125
+ values:
126
+ myval: "Test"
127
+ """
128
+ When I run jekyll build
129
+ Then the _site directory should exist
130
+ And I should see "Value: Override" in "_site/slides/slide2.html"
131
+
132
+ Scenario: Deep merge frontmatter defaults
133
+ Given I have an "index.html" page with fruit "{orange: 1}" that contains "Fruits: {{ page.fruit.orange | plus: page.fruit.apple }}"
134
+ And I have a configuration file with "defaults" set to "[{scope: {path: ""}, values: {fruit: {apple: 2}}}]"
135
+ When I run jekyll build
136
+ Then I should see "Fruits: 3" in "_site/index.html"
@@ -70,6 +70,18 @@ Feature: Post data
70
70
  Then the _site directory should exist
71
71
  And I should see "Post category: movies" in "_site/movies/2009/03/27/star-wars.html"
72
72
 
73
+ Scenario: Use post.categories variable when category is in a folder and has categories in YAML
74
+ Given I have a movies directory
75
+ And I have a movies/_posts directory
76
+ And I have a _layouts directory
77
+ And I have the following post in "movies":
78
+ | title | date | layout | categories | content |
79
+ | Star Wars | 2009-03-27 | simple | [film] | Luke, I am your father. |
80
+ And I have a simple layout that contains "Post category: {{ page.categories }}"
81
+ When I run jekyll build
82
+ Then the _site directory should exist
83
+ And I should see "Post category: movies" in "_site/movies/film/2009/03/27/star-wars.html"
84
+
73
85
  Scenario: Use post.tags variable
74
86
  Given I have a _posts directory
75
87
  And I have a _layouts directory