Check key in collections only if it isn't "posts" (#7277)

Merge pull request 7277
This commit is contained in:
Ashwin Maroli 2018-09-26 19:48:57 +05:30 committed by jekyllbot
parent 44a8035d13
commit 57da5c0e29
1 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@ module Jekyll
private def_delegator :@obj, :config, :fallback_data
def [](key)
if @obj.collections.key?(key) && key != "posts"
if key != "posts" && @obj.collections.key?(key)
@obj.collections[key].docs
else
super(key)
@ -21,7 +21,7 @@ module Jekyll
end
def key?(key)
(@obj.collections.key?(key) && key != "posts") || super
(key != "posts" && @obj.collections.key?(key)) || super
end
def posts