I'm currently working on my first Jekyll site. I have a page in which 2 seperate sections display previews of certain posts (a styled thumbnail).
What I want is for these sections to display posts from different subfolders in _site/_posts. I have organized _posts to contain two subfolders, /lesplannen and /verslagen (lesson plans and reports), each containing a bunch of articles.
My code for one of these sections is as follows (Jade formatting):
{% for post in site.posts limit: 4 %}
a(href="{{post.url}}" target="_blank" style="background-image: url(assets/img/posts/lesplannen/thumbnails/{{post.thumbnail}})").lesplan-thumb
.article-meta
.name {{post.title}}
.date {{ post.date | date: "%b %d, %Y" }}
{% endfor %}
And similarly for the other section. My first instinct was to change site.posts to site.posts.lesplannen and site.posts.verslagen repectively, but this resulted in the thumbs not displaying at all. I also added the categories to the front matter in the articles themselves, but this wasn't picked up either.
For clarity, what I'm trying to do is have section 1 display posts from _site/_posts/subfolder 1 and section 2 display posts from _site/_posts/subfolder 2.
What would be the right way to go about this?
Question for bonus points: The page displays 4 posts, as expected, but chooses to display post 6 through 9 of the 12 posts available. Why is this and can I specify to e.g. always display the last x posts?
For reference:
GitHub page: https://zaena.github.io/portfolio-nadine/
GitHub repo: https://github.com/Zaena/portfolio-nadine