mirror of
https://github.com/jekyll/jekyll.git
synced 2026-02-01 10:15:03 -05:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user