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

Fix bad config YAML in collections example #5587

Merged
merged 1 commit into from Nov 29, 2016

Conversation

happycollision
Copy link
Contributor

If you add the previous version to your config file, you'd get an error on build/serve.

If you add the previous version to your config file, you'd get an error on build/serve.
Copy link
Member

@pathawks pathawks left a comment

Choose a reason for hiding this comment

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

collections needs to be an array, not a hash.

@happycollision
Copy link
Contributor Author

That's what I thought, but putting this into the config file:

collections:
  - my_collection:
      output: true

results in this error in the terminal:

Configuration file: /Users/Don/Git Projects/some-site/_config.yml
            Source: /Users/Don/Git Projects/some-site
       Destination: /Users/Don/Git Projects/some-site/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
jekyll 3.0.2 | Error:  undefined method `gsub' for {"my_collection"=>{"output"=>true}}:Hash

Conversely, this

collections:
  my_collection:
    output: true

produces no errors and behaves as expected (the collection outputs and I can access it at site.my_collection).

This also seems to be exactly in line with the current documentation for collections. (Or that same collection documentation from the latest commit on master)

Just above that link on those pages is the "Step 1" section, which seems to suggest that if you want to specify metadata for a collection, you must not use an array. From the documentation:

Add the following to your site's _config.yml file, replacing my_collection
with the name of your collection:

collections:
- my_collection

You can optionally specify metadata for your collection in the configuration:

collections:
  my_collection:
    foo: bar

Am I missing something?

@pathawks pathawks dismissed their stale review November 17, 2016 16:46

I guess you're right 👍

Copy link
Member

@ashmaroli ashmaroli left a comment

Choose a reason for hiding this comment

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

👍

@DirtyF DirtyF self-assigned this Nov 22, 2016
@parkr
Copy link
Member

parkr commented Nov 29, 2016

Thank you!

@jekyllbot: merge +site

@jekyllbot jekyllbot merged commit ec7378a into jekyll:master Nov 29, 2016
jekyllbot added a commit that referenced this pull request Nov 29, 2016
@happycollision happycollision deleted the patch-1 branch November 29, 2016 05:28
@jekyll jekyll locked and limited conversation to collaborators Jul 11, 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.

None yet

6 participants