scratching my head over this - help much appreciated.
I want to display a list of all my Jekyll posts, organised by category. I know Line 3 isn\'t correct but I can
Here's an answer that uses sorting (useful!):
{% comment %}
#
# Change date order by adding '| reversed'
# To sort by title or other variables use {% assign sorted_posts = category[1] | sort: 'title' %}
#
{% endcomment %}
{% assign sorted_cats = site.categories | sort %}
{% for category in sorted_cats %}
{% assign sorted_posts = category[1] | reversed %}
{{category[0] | capitalize}}
{% for post in sorted_posts %}
- {{ post.title }}
{% endfor %}
{% endfor %}
This is not mine, it's taken from here.