Use Jekyll Folder with option to list categories

Asked

Viewed 118 times

1

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

|- My-Theme/
| |- Blogger/
| | |- _posts/
| |- Projects/
| | |- _posts/

What I want to do is list the posts using the Paginator from Jekyll, for this I’m doing so:

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

Just so lists all the files, both of the subfolder _posts of the briefcase Blogger, how much of the sub-folder _posts of the briefcase Projects, and I just want to list the folder Blooger on my index. I did so:

{% for posting in site.categories.blog %} {{ posting.title }} {% endfor %} This way it lists only the posts of categories blog, but I have to use the "Paginator" to create my pages, understood?

The pagination part is right, configured in the file _config.yml, and the file header . Md of the folder Blogger and the folder Projects, is like this:

layout: post title: "titulo" categories: blog

Can anyone help me out on how to place Wordpress but filtering by post categories?

Thank you. Thank you in advance.

1 answer

0

To get what you want I recommend you use collections.

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

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 in http://jekyllrb.com/docs/collections/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.