I have this piece of code that executes a sort for this kind of structure:
items:
0:
date: '2018-01-02'
1:
date: '2019-02-02'
2:
date: '2016-03-04'
Sort:
{% assign sorted = items.sort {|x,y| y[1].date <=> x[1].date} %}
Based on: https://stackoverflow.com/a/5710429/2797942
When I run jekyll serve
it returns Liquid Warning: Liquid syntax error (line 18): Unexpected character { in "{{items.sort {|x,y| y[1].date <=> x[1].date} }}
I'm quite new to Ruby and Jekyll, can someone help me out?