jekyll: List of collections not rendering
I am trying to build a list of the collections I have defined in my _config.yml, thus:
collections:
articles:
output: true
title: Articles
essays:
output: true
title: Academic Essays
presentations:
output: true
title: Presentations
projects:
output: true
title: Projects
using the following Liquid template:
{% for collection in site.collections %}
<section>
<h1><a href="{{ collection.directory }}">{{ collection.title }}</a></h1>
Label: {{ collection.label }}
</section>
{% endfor %}
but the following is rendered:
<section>
<h1><a href=""></a></h1>
Label:
</section>
<section>
<h1><a href=""></a></h1>
Label:
</section>
<section>
<h1><a href=""></a></h1>
Label:
</section>
<section>
<h1><a href=""></a></h1>
Label:
</section>
The documentation says:
…collections are also available under
site.collections
, with the metadata you specified in your_config.yml
…
Is what I’m attempting correct? Or is this a bug?
Thanks—and congratulations on shipping v2!
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 35 (20 by maintainers)
Commits related to this issue
- fix collections output, see #2346 — committed to jekyll/jekyll by bernardodiasc 9 years ago
- fix collections output, see #2346 — committed to jekyll/jekyll by bernardodiasc 9 years ago
- fixes #1. thanks @FloFra https://github.com/jekyll/jekyll/issues/2346#issuecomment-88512571 — committed to bullgit/media by Haroenv 9 years ago
just commenting that @FloFra’s method doesn’t seem to be working anymore. To get a similar behaviour, I now used: