diff --git a/features/collections.feature b/features/collections.feature index 32e9161c..402e7dab 100644 --- a/features/collections.feature +++ b/features/collections.feature @@ -70,3 +70,15 @@ Feature: Collections When I run jekyll build Then the _site directory should exist 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" + + Scenario: All the documents + Given I have an "index.html" page that contains "All documents: {% for doc in site.documents %}{{ doc.relative_path }} {% endfor %}" + And I have fixture collections + And I have a "_config.yml" file with content: + """ + collections: + - methods + """ + When I run jekyll build + Then the _site directory should exist + And I should see "All documents: _methods/configuration.md _methods/sanitized_path.md _methods/site/generate.md _methods/site/initialize.md _methods/um_hi.md" in "_site/index.html" diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index 5350edec..5ebf3c20 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -413,7 +413,7 @@ module Jekyll def documents collections.reduce(Set.new) do |docs, (_, collection)| docs.merge(collection.docs) - end + end.to_a end def each_site_file