Return unless 'jekyll-archives' config is a Hash#139
Merged
jekyllbot merged 1 commit intojekyll:masterfrom Aug 21, 2019
Merged
Conversation
mattr-
requested changes
Apr 23, 2019
Member
mattr-
left a comment
There was a problem hiding this comment.
One nit about wording, but good otherwise.
| @config = Utils.deep_merge_hashes(DEFAULTS, archives_config) | ||
| else | ||
| @config = nil | ||
| Jekyll.logger.warn "Archives:", "Expected a hash but got #{archives_config.inspect}" |
Member
There was a problem hiding this comment.
Do we need to force our users to care about data structures? What about something like
Suggested change
| Jekyll.logger.warn "Archives:", "Expected a hash but got #{archives_config.inspect}" | |
| Jekyll.logger.warn "Archives:", "The configuration appears to be invalid" |
Member
Author
There was a problem hiding this comment.
@mattr- I'm not sure about this suggestion..
When a third-party plugin (e.g. jekyll-algolia) erroneously sets config["jekyll-archives"] to nil explicitly, a simple "The configuration appears to be invalid" is going to throw the user into more confusion because:
- First of all, their config file doesn't have a
jekyll-archiveskey. - Secondly, they have no context as to why the configuration is invalid.
- they have no backtrace to debug on their own.
Member
|
@jekyllbot: merge +fix |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If the user or a third-party plugins sets
config["jekyll-archives"]tonilor something but a Hash, output a warning and turn-off the archives generator.Closes #138