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

Ensure site.data.authors is properly formatted before attempting to retrieve author meta #227

Merged
merged 7 commits into from
Aug 22, 2017

Conversation

benbalter
Copy link
Collaborator

If site.data.authors is an array, or if site.data.authors[author] is anything other than a Hash, the build will error out.

This PR makes Drop#author_hash a bit more robust by ensuring site.data.authors and site.data.authors[author] is a hash before attempting to access it or add additional elements.

The user-facing functionality should be identical, but more robust.

This problem arises when Jekyll SEO Tag is included (by default in some cases) on GitHub Pages, and the user has a _data/authors.yml that was not formatted to work with Jekyll SEO tag.

@benbalter
Copy link
Collaborator Author

Failing test fixed via #228.

@benbalter benbalter requested review from DirtyF, pathawks and parkr August 22, 2017 16:07
Copy link
Member

@DirtyF DirtyF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯
Tested: No build error if authors is an array whether it's in the post Front Matter, the _config .yml or the authors.yaml data file. Excellent.

@benbalter benbalter merged commit 9fbeded into master Aug 22, 2017
@benbalter benbalter deleted the site-authors-array branch August 22, 2017 17:11
@benbalter
Copy link
Collaborator Author

Thanks for the 👀! 😄

benbalter added a commit that referenced this pull request Aug 22, 2017
@jekyll jekyll locked and limited conversation to collaborators Apr 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants