Ask about 'Draft' before asking about 'Post'
`Draft`s are a subclass of `Post` so `draft.is_a?(Post)` will return `true`, thus making all `Draft`s `Post`s, which is not desired. If asking about `Draft` first, then we avoid this problem. Fixes #2726
This commit is contained in:
parent
60c29561f2
commit
9c090c862f
|
@ -128,12 +128,12 @@ module Jekyll
|
|||
#
|
||||
# Returns the type of self.
|
||||
def type
|
||||
if is_a?(Post)
|
||||
if is_a?(Draft)
|
||||
:drafts
|
||||
elsif is_a?(Post)
|
||||
:posts
|
||||
elsif is_a?(Page)
|
||||
:pages
|
||||
elsif is_a?(Draft)
|
||||
:drafts
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue