Working with for loops for display lists


I have my specials displayed in a list using a for loop and when clicked on the specials details spit out underneath. The problem I want the most recent special to spit when the user arrives on the special page without having to be clicked on. I would imagine there would have to be some kind of condition for this. This is beyond my skill set. Could someone help point me in the right direction?


I think you already know how :slight_smile: you just a bit afraid to experiment… simply embed the first post content into your Specials page and this is it.

Put the following snippet into specials-page.html and you are done:

layout: specials-post

{{ site.categories.specials-collect.first.content }}

I forked your repo and put together an example how does it look like:

And here is the Github’s repository with the change:

And I also sent a pull request, so you can accept it and get the changes in your repository instantly.

Let me know if that is what you are looking for :wink:


BTW, I like the way you organized Specials pages - very smart, I would have never though about putting together an empty page with the same layout as an entry point (eq. parent) for other pages/content to show up!



Ahh, what a gift I woke up to this morning. I pulled in the changes. This exactly what I’m looking for. Thanks man. :slight_smile:


Enjoy! :wink: Glad it has worked for you!