Skip to content
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

Merged
merged 4 commits into from
Oct 30, 2015

Conversation

alfredxing
Copy link
Member

@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!

@paulrobertlloyd
Copy link
Contributor

@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
Copy link
Member

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.

Copy link
Member Author

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....

Copy link
Contributor

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.

Copy link
Member

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! :shipit:

Copy link
Member Author

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!

alfredxing added a commit that referenced this pull request Oct 30, 2015
@alfredxing alfredxing merged commit 137dacd into master Oct 30, 2015
@alfredxing alfredxing deleted the post-collections branch October 30, 2015 21:33
alfredxing added a commit that referenced this pull request Oct 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants