Merge pull request #5067 from jekyll/excerpt-drop-previous-doc
Merge pull request 5067
This commit is contained in:
commit
146d0f301d
|
@ -102,8 +102,8 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# Returns true if the given key is present
|
# Returns true if the given key is present
|
||||||
def key?(key)
|
def key?(key)
|
||||||
if self.class.mutable && @mutations.key?(key)
|
if self.class.mutable
|
||||||
true
|
@mutations.key?(key)
|
||||||
else
|
else
|
||||||
respond_to?(key) || fallback_data.key?(key)
|
respond_to?(key) || fallback_data.key?(key)
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,7 +7,8 @@ module Jekyll
|
||||||
attr_writer :output
|
attr_writer :output
|
||||||
|
|
||||||
def_delegators :@doc, :site, :name, :ext, :relative_path, :extname,
|
def_delegators :@doc, :site, :name, :ext, :relative_path, :extname,
|
||||||
:render_with_liquid?, :collection, :related_posts, :url
|
:render_with_liquid?, :collection, :related_posts,
|
||||||
|
:url, :next_doc, :previous_doc
|
||||||
|
|
||||||
# Initialize this Excerpt instance.
|
# Initialize this Excerpt instance.
|
||||||
#
|
#
|
||||||
|
|
|
@ -29,6 +29,10 @@ class TestExcerptDrop < JekyllUnitTest
|
||||||
assert_equal @excerpt_drop["layout"], @doc_drop["layout"]
|
assert_equal @excerpt_drop["layout"], @doc_drop["layout"]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
should "be inspectable" do
|
||||||
|
refute_empty @excerpt_drop.inspect
|
||||||
|
end
|
||||||
|
|
||||||
should "inherit values from the document" do
|
should "inherit values from the document" do
|
||||||
assert_equal @excerpt_drop.keys.sort, @doc_drop.keys.sort
|
assert_equal @excerpt_drop.keys.sort, @doc_drop.keys.sort
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue