Write test for site.documents.
This commit is contained in:
parent
fc98f06ed7
commit
3755437d08
|
@ -70,3 +70,15 @@ Feature: Collections
|
||||||
When I run jekyll build
|
When I run jekyll build
|
||||||
Then the _site directory should exist
|
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"
|
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"
|
||||||
|
|
|
@ -413,7 +413,7 @@ module Jekyll
|
||||||
def documents
|
def documents
|
||||||
collections.reduce(Set.new) do |docs, (_, collection)|
|
collections.reduce(Set.new) do |docs, (_, collection)|
|
||||||
docs.merge(collection.docs)
|
docs.merge(collection.docs)
|
||||||
end
|
end.to_a
|
||||||
end
|
end
|
||||||
|
|
||||||
def each_site_file
|
def each_site_file
|
||||||
|
|
Loading…
Reference in New Issue