使用Jekyll /液体模板订购数组

Yan*_*all 9 liquid jekyll

我正在尝试做以下事情.我使用Jekyll创建一个帖子列表,并按类别进行排序(星期一......星期日)我希望按时间顺序显示它们,但是Jekyll按字母顺序排序.

是否有可能与杰基尔分拣?

我已经将一个订单键添加到帖子yaml以镜像monday = 1 ... sunday = 7

我正试图用这个订单键对数组进行排序,但它不起作用.

  {% for post in posts_collate  %}
    {% capture class %} {{ post.tags | first }} {% endcapture%}
    {% capture club %} {{ post.tags | last }} {% endcapture%}

    {% if forloop.first %}
      <h2>our events</h2>
      <h3>{{ class }} & {{ club }}</h3>
      <dl>
    {% endif %}
    {% if post.rel == 'me' %}
      <dt>{{ post.category | sort: 'order' }}</dt> 
      <dd> <a href="{{ BASE_PATH }}{{ post.url }}">{{ post.title }}</a></dd>
    {% endif %}

    {% if forloop.last %}
      </dl>
    {% endif %}
  {% endfor %}
Run Code Online (Sandbox Code Playgroud)

我在大型谷歌机器上找不到任何信息,所以我不确定它是否有可能.

Yan*_*all 0

好吧,不确定是否可以进行这种排序,但我有点作弊 \n(\xe2\x80\xa2__\xc2\xb0)

\n\n

我刚刚将我想要订购的帖子重命名为特定日期,例如:

\n\n

0000-00-01-firstpost\netc...

\n\n

现在为我做,但如果有更聪明的方法来做到这一点,我愿意(^___^)

\n