Order an array with Jekyll / liquid template

那年仲夏 提交于 2019-12-01 15:54:14

It cannot be done without a plugin or custom function. Although, there is an ongoing effort to implement this in the next releases: https://github.com/Shopify/liquid/pull/101 and then it would look like:

{% for tag in site.tags order:ascending %} 
   ...
{% endfor %}

simply add reversed in the for statement

 {% for post in site.posts reversed %}
   ...
 {% endfor %}
Yannick Schall

Ok, not sure it is possible at all to do this kind of sorting, but i've cheated a bit (•__°)

I just renamed the post that i want to be order with a specific date like:

0000-00-01-firstpost etc...

Does it for me for now, but if there is a more clever way to do that, I'm up for it (^___^)

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!