Use the 'output' key instead of 'write' for writing out collections' document files.
This commit is contained in:
parent
2ccf7f1cfb
commit
6225073095
|
@ -20,7 +20,7 @@ Feature: Collections
|
||||||
"""
|
"""
|
||||||
collections:
|
collections:
|
||||||
methods:
|
methods:
|
||||||
write: true
|
output: true
|
||||||
foo: bar
|
foo: bar
|
||||||
"""
|
"""
|
||||||
When I run jekyll build
|
When I run jekyll build
|
||||||
|
@ -37,7 +37,7 @@ Feature: Collections
|
||||||
"""
|
"""
|
||||||
collections:
|
collections:
|
||||||
methods:
|
methods:
|
||||||
write: true
|
output: true
|
||||||
foo: bar
|
foo: bar
|
||||||
"""
|
"""
|
||||||
When I run jekyll build
|
When I run jekyll build
|
||||||
|
@ -46,7 +46,7 @@ Feature: Collections
|
||||||
And I should see "<p>Run your generators! default</p>" in "_site/methods/site/generate.html"
|
And I should see "<p>Run your generators! default</p>" in "_site/methods/site/generate.html"
|
||||||
And I should see "<div class='title'>Tom Preston-Werner</div>" in "_site/methods/site/generate.html"
|
And I should see "<div class='title'>Tom Preston-Werner</div>" in "_site/methods/site/generate.html"
|
||||||
|
|
||||||
Scenario: Collections directly on the site
|
Scenario: Collections specified as an array
|
||||||
Given I have an "index.html" page that contains "Collections: {% for method in site.methods %}{{ method.relative_path }} {% endfor %}"
|
Given I have an "index.html" page that contains "Collections: {% for method in site.methods %}{{ method.relative_path }} {% endfor %}"
|
||||||
And I have fixture collections
|
And I have fixture collections
|
||||||
And I have a "_config.yml" file with content:
|
And I have a "_config.yml" file with content:
|
||||||
|
@ -57,3 +57,16 @@ 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: Collections specified as an hash
|
||||||
|
Given I have an "index.html" page that contains "Collections: {% for method in site.methods %}{{ method.relative_path }} {% endfor %}"
|
||||||
|
And I have fixture collections
|
||||||
|
And I have a "_config.yml" file with content:
|
||||||
|
"""
|
||||||
|
collections:
|
||||||
|
methods:
|
||||||
|
baz: bin
|
||||||
|
"""
|
||||||
|
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"
|
||||||
|
|
|
@ -129,7 +129,7 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# Returns true if the 'write' metadata is true, false otherwise.
|
# Returns true if the 'write' metadata is true, false otherwise.
|
||||||
def write?
|
def write?
|
||||||
!!metadata['write']
|
!!metadata['output']
|
||||||
end
|
end
|
||||||
|
|
||||||
# Extract options for this collection from the site configuration.
|
# Extract options for this collection from the site configuration.
|
||||||
|
|
|
@ -74,9 +74,9 @@ class TestCollections < Test::Unit::TestCase
|
||||||
|
|
||||||
should "know whether it should be written or not" do
|
should "know whether it should be written or not" do
|
||||||
assert_equal @collection.write?, false
|
assert_equal @collection.write?, false
|
||||||
@collection.metadata['write'] = true
|
@collection.metadata['output'] = true
|
||||||
assert_equal @collection.write?, true
|
assert_equal @collection.write?, true
|
||||||
@collection.metadata.delete 'write'
|
@collection.metadata.delete 'output'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue