From 85462980478df760edbf201d4b4bd7bad437e1b5 Mon Sep 17 00:00:00 2001 From: Bernardo Dias Date: Sat, 24 Jan 2015 19:40:43 -0200 Subject: [PATCH 1/2] fix collections output, see #2346 --- lib/jekyll/site.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index b909bece..92aa0f39 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -251,7 +251,7 @@ module Jekyll "html_pages" => pages.select { |page| page.html? || page.url.end_with?("/") }, "categories" => post_attr_hash('categories'), "tags" => post_attr_hash('tags'), - "collections" => collections, + "collections" => collections.values.map(&:to_liquid), "documents" => documents, "data" => site_data })) From 6a26907495131c9eba998808805aced92d39c4c9 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 20 Apr 2015 10:54:09 -0700 Subject: [PATCH 2/2] features: update collections features to match new iteration method --- features/collections.feature | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/features/collections.feature b/features/collections.feature index 91a271fc..dc4ea311 100644 --- a/features/collections.feature +++ b/features/collections.feature @@ -14,7 +14,7 @@ Feature: Collections Scenario: Rendered collection Given I have an "index.html" page that contains "Collections: {{ site.collections }}" - And I have an "collection_metadata.html" page that contains "Methods metadata: {{ site.collections.methods.foo }} {{ site.collections.methods }}" + And I have an "collection_metadata.html" page that contains "Methods metadata: {{ site.collections[0].foo }} {{ site.collections[0] }}" And I have fixture collections And I have a "_config.yml" file with content: """ @@ -25,7 +25,8 @@ Feature: Collections """ When I run jekyll build Then the _site directory should exist - And I should see "Collections: {\"methods" in "_site/index.html" + And I should see "Collections: {\"output\"=>true" in "_site/index.html" + And I should see "\"label\"=>\"methods\"," in "_site/index.html" And I should see "Methods metadata: bar" in "_site/collection_metadata.html" And I should see "

Whatever: foo.bar

" in "_site/methods/configuration.html" @@ -56,7 +57,8 @@ Feature: Collections """ When I run jekyll build Then the _site directory should exist - And I should see "Collections: {\"methods" in "_site/index.html" + And I should see "Collections: {\"output\"=>true" in "_site/index.html" + And I should see "\"label\"=>\"methods\"," in "_site/index.html" And I should see "

Run your generators! default

" in "_site/methods/site/generate.html" And I should see "
Tom Preston-Werner
" in "_site/methods/site/generate.html"