Skip to content

Instantly share code, notes, and snippets.

@budparr
Last active January 25, 2016 03:26
Show Gist options
  • Save budparr/70299d15adf0f3875728 to your computer and use it in GitHub Desktop.
Save budparr/70299d15adf0f3875728 to your computer and use it in GitHub Desktop.
get a config defined variable for a collectionhttps://github.com/jekyll/jekyll/issues/4392#issuecomment-174369983
If I have a _config.yml with:
collections:
my_collection:
foo: bar
And a template with
```
{% assign collectionName = 'my_collection' %}
or
{% assign collectionName = page.collection %}
{% assign d = site.collections | where:'label',collectionName | first %}
{{ d.foo }}
```
My output is, as expected:
bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment