【发布时间】:2014-04-10 00:33:34
【问题描述】:
我将每个帖子都作为公司在建筑物中,我想通过suite 为每个帖子(公司)订购每个帖子的 yml 前端中设置的数字。我该怎么做?
【问题讨论】:
标签: jekyll
我将每个帖子都作为公司在建筑物中,我想通过suite 为每个帖子(公司)订购每个帖子的 yml 前端中设置的数字。我该怎么做?
【问题讨论】:
标签: jekyll
Here's another question that asked something similar,只是使用“常规”页面而不是博客文章。
根据您的需求调整接受的答案(suite 和帖子,而不是 weight 和页面),您需要执行以下操作:
suite:---
layout: post
title: whatever
date: 2014/04/19 00:00
suite: 3
---
suite排序的所有帖子列表:<ul>
{% for suite in (1..10) %}
{% for post in site.posts %}
{% if post.suite == suite %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endif %}
{% endfor %}
{% endfor %}
</ul>
【讨论】: