Jekyll 按邮政yml前件号订购邮政
我把每一个帖子作为一个公司放在一栋楼里,我想按照每个帖子的yml首页上设置的编号来订购每个帖子(公司)。我怎样才能做到这一点呢?,只使用“常规”页面而不是博客帖子 根据您的需要调整公认的答案(Jekyll 按邮政yml前件号订购邮政,jekyll,Jekyll,我把每一个帖子作为一个公司放在一栋楼里,我想按照每个帖子的yml首页上设置的编号来订购每个帖子(公司)。我怎样才能做到这一点呢?,只使用“常规”页面而不是博客帖子 根据您的需要调整公认的答案(suite和帖子,而不是weight和页面),您需要执行以下操作: 在每个帖子的前面定义一个套件: 显示按suite排序的所有帖子的列表: {(1..10)%%中的套件为% {site.posts%中的post为%s} {%if post.suite==suite%} {%endif%} {%endfo
suite
和帖子,而不是weight
和页面),您需要执行以下操作:
在每个帖子的前面定义一个套件
:
显示按suite
排序的所有帖子的列表:
{(1..10)%%中的套件为%
{site.posts%中的post为%s}
{%if post.suite==suite%}
{%endif%}
{%endfor%}
{%endfor%}
---
layout: post
title: whatever
date: 2014/04/19 00:00
suite: 3
---
<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>