Using Jekyll creating a news feed

1

I have the following question how do I create a news feed? Do I have to add something inside the config.yml file?

Inside the _post folder I have the file 2015-03-03-welcome-jekyll.markdown

---
layout: post
title:  "Welcome to Jekyll!"
date:   2015-03-03 14:47:43
categories: "jekyll update"
---

If I do so in inha view

{% for post in site.posts limit:20 %}  
            <li>  
                <span>{{ post.date | date_to_string }}</span> &raquo;  
                <a href="{{ BASE_PATH }}{{ post.url }}">  
                     {{ post.title }}
                </a>  
            </li>  
{% endfor %} 

It works fine, but if I rename the _posts folder to _notices and change in the loop from site.posts to site.notices and run it it does not work. My question is how can I create news, testimonials?

    
asked by anonymous 06.03.2015 / 17:12

1 answer

1

In Jekyll there is a concept called "collections". An example is the post collection that is created by default with the files in the _post directory.

To create a new collection you need to declare it in _config.yml . For example:

collections:
  news:
    output: true
# outras configurações...

Files must be in a _news directory.

Check out the documentation for more options on file generation and format customization: link

    
07.04.2015 / 20:58