I referred the link on How to customize the sorting of items on a page with jekyll. While the idea is very similar to what I need, the setup doesn't quite work for me.
Scenario:
I have a list of posts, each having only one category, such as category A
, category B
, category C
, and so on. The order I need them in is category B
, category A
, category C
.
Current setup
The current MWE of loop.html
is as follows:
{% for category in site.categories %}
<h3>{{ category[0] | capitalize }}</h3>
{% for post in category[1] %}
<h4><a href="{{ post.url }}">{{ post.title }}</a></h4>
{{ post.excerpt }}
{% endfor %}
{% endfor %}
This just sorts based on the post date, I believe. I could do the alphabetical sort, but could not get it to be B
, A
, C
.
All of my posts have category, and each has only one category.
When I took the steps shown in the post at the aforementioned link, the loop came off blank.