0

Structure of my project:

/_config.yml
./_layouts
./_posts
./_posts/2011-07-29-my-first-jekyll-post.markdown
./_notices/2011-07-29-my-first-notice.markdown
./_notices/2011-07-30-my-second-notice.markdown
./_site
./index.html

With post it works:

{% for post in site.posts %}
 ... listing all posts ...
{% endfor %}

With news not working:

{% for notice in site.notices %}
 ... listing all notices ...
{% endfor %}

Notices does not work. How can I achieve a listing of items similar to the post listing?

1 Answers1

2

By default, only the _posts folder holds iterable items. If you use a recent version of Jekyll, you can use the new collections feature. In your example, add the following to your _config.yml

collections:
  - noticies

Please note, though, that this feature is in its early development and might change until the it stabilizes. Also, just for the record, the English plural of notice is notices.

David Jacquel
  • 51,670
  • 6
  • 121
  • 147
Dennis Schubert
  • 640
  • 5
  • 11
  • 1
    Perhaps Tiago Casanova speaks [Catalan](https://translate.google.com/?ie=UTF-8&hl=en&client=tw-ob#auto/en/noticies)? – Max Mar 11 '15 at 14:33
  • Possible. The rest of the path is English, though. And I actually spent hours of debugging time with mistakes like that, so a small hint could be useful. :) – Dennis Schubert Mar 11 '15 at 14:34
  • Please mark the answer as accepted if that solved your problem. :) – Dennis Schubert Mar 16 '15 at 15:18