Somewhat of a head scratcher for me.
I have a simple project with some mostly empty test posts.
It’s the most basic blog layout in existence.
The issue is the homepage (Leftmost square, “Say something for The Main Page”)
I have this in index.html
<ul class='post-list'>
{% for dir in site.collections %}
{% assign collection = dir.label %}
{% for page in site[collection] %}
{% include icon.html %}
<li>
<img class='collection-icon' src="{{ src }}" alt="">
<h2> <a href="{{ page.url | prepend: site.baseurl }}">{{ page.title }}</a> </h2>
<small>{{ page.date | date: "%b %-d, %Y" }}</small>
</li>
{% endfor %}
{% endfor %}
</ul>
However, this is not what I’m looking to accomplish.
I would like to see each post organized by date newest to oldest.
To be sure, I do not want each category, and then each post of that category listed by date (we could just use more or less the same code with reverse for that).
From what I’ve come to read (I’ve lost the link will edit momentarily) site.categories
only loops the categories within the posts of the _posts
dir. Is that correct? I know when I add either category: home
or categories: home
to any page in any dir that isn’t posts (a collection) site.categories
is empty.
Besides a massive refactor, or duplicating each post in the _posts
dir, how might one accomplish this?