Using liquid to sort posts alphabetically

后端 未结 7 1269
借酒劲吻你
借酒劲吻你 2021-02-01 19:45

Is there a way to sort a number of posts alphabetically, using Jekyll?

I have something like this now:

{% for post in site.categories.threat %}


        
7条回答
  •  花落未央
    2021-02-01 20:10

    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 %}
    

    See also: Order an array with Jekyll / liquid template

提交回复
热议问题