-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support revised documents/collections in Jekyll 3 (v2) #53
Conversation
Signed-off-by: Alfred Xing <[email protected]>
Signed-off-by: Alfred Xing <[email protected]>
@alfredxing Not a problem! Learnt a few things while making the changes too, which is no bad thing 😀 |
@posts.each { |p| hash[p.date.strftime("%Y")] << p } | ||
|
||
# In Jekyll 3, Collection#each should be called on the #docs array directly. | ||
if defined? @posts.docs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were doing a version check Jekyll::VERSION < '3.0.0'
to determine if it should be treated as an array or not. What do you think about each approach? I'm not sure which I like better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paulrobertlloyd Mentioned that this is technically 'safer', but I think checking the version is more understandable....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only did it this way because I didn’t know how to test for the version number! Agree that using version number is cleaner and more understandable. Happy for this test to be changed to that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with either!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll make the quick fix & merge!
@parkr It works! I think originally I wasn't too sure because this now uses the site's posts object instead of ours, but they should be the same anyways.
@paulrobertlloyd I've kept your commits in here since we do still need the checks when constructing the archives by year. Thanks for your work on this!