Use Jekyll paginator with option to list categories

1

I have two directories in my Jekyll theme, the Blogger folder, and the Projects folder, these folders contain the subfolder ** _ posts * inside. As in the example below:

| - My Theme /
| | - News and Announcements | | Search Forums | | - News & Events | | | - _posts /

What I want to do is list the posts using jekyll's paginator , so I'm doing it like this:

{% for posting in paginator.posts %} {{ posting.title }} {% endfor %}

But so it lists all the files, both from the _posts subfolder of the Blogger folder, and from the _posts subfolder of the Projects folder , and I just want to list the Blooger folder in my index. I did so:

{% for posting in site.categories.blog %} {{ posting.title }} {% endfor %} That way it lists only the blog category posts, but I have to use "paginator" to create my pages, do you understand?

The pagination part is set, set it up in the _config.yml file, and the header of the .md files in the Blogge folder is in the Projects < strong>, it looks like this:

layout: post title: "titulo" categories: blog

Can someone help me with how to put the paginator but filtering by categories of the posts?

Thank you. already grateful.

    
asked by anonymous 21.03.2015 / 23:43

1 answer

0

To get what you want I recommend that you use collections .

Continue with your posts in the traditional way and save your projects in the _projects directory.

Add these lines to _config.yml :

collections:
  courses:
    output: true
    values:
      layout: page

Use the loop in projects from

{% for project in site.projects ...

Learn more about collections at link

    
22.07.2015 / 14:31